[XEND] Make python-pam warning only appear if using XenAPI

Signed-off-by: Alastair Tse <atse@xensource.com>
This commit is contained in:
Alastair Tse committed 2007-01-31 12:58:41 +00:00
1 parent 3f44314932
commit 6501ac6994
1 file changed
+4 -5
+4 -5
View File
@@ -21,11 +21,6 @@ from xen.xend import uuid
from xen.xend.XendError import *
from xen.xend.XendLogging import log
try:
import PAM
except ImportError:
log.warn("python-pam is required for XenAPI support.")
class XendAuthSessions:
"""Keeps track of Xen API Login Sessions using PAM.
@@ -80,7 +75,11 @@ class XendAuthSessions:
"""
pam_auth = None
try:
import PAM
pam_auth = PAM.pam()
except ImportError:
log.warn("python-pam is required for XenAPI support.")
return False
except NameError:
# if PAM doesn't exist, let's ignore it
return False
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.