mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
[XEND] Make python-pam warning only appear if using XenAPI
Signed-off-by: Alastair Tse <atse@xensource.com>
This commit is contained in:
1 parent
3f44314932
commit
6501ac6994
1 file changed
+4
-5
@@ -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
|
||||
|
||||