WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] [XEND] Make python-pam warning only appea

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XEND] Make python-pam warning only appear if using XenAPI
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 31 Jan 2007 09:05:06 -0800
Delivery-date: Wed, 31 Jan 2007 09:04:48 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Alastair Tse <atse@xxxxxxxxxxxxx>
# Date 1170248321 0
# Node ID 7c992fd3b19ba3f7094e0c01205a481dc74661f8
# Parent  54678a99e1020c3f761416674e43626f4a553778
[XEND] Make python-pam warning only appear if using XenAPI

Signed-off-by: Alastair Tse <atse@xxxxxxxxxxxxx>
---
 tools/python/xen/xend/XendAuthSessions.py |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff -r 54678a99e102 -r 7c992fd3b19b tools/python/xen/xend/XendAuthSessions.py
--- a/tools/python/xen/xend/XendAuthSessions.py Wed Jan 31 12:23:35 2007 +0000
+++ b/tools/python/xen/xend/XendAuthSessions.py Wed Jan 31 12:58:41 2007 +0000
@@ -20,11 +20,6 @@ from xen.xend import uuid
 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

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [XEND] Make python-pam warning only appear if using XenAPI, Xen patchbot-unstable <=