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/
Home Products Support Community News


[Xen-changelog] [xen-unstable] pygrub: Correct pygrub return value

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] pygrub: Correct pygrub return value
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 15 Sep 2009 02:00:33 -0700
Delivery-date: Tue, 15 Sep 2009 02:01:43 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/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 Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1253002894 -3600
# Node ID 67f1b8b3258591b979c441c6013af3c442063cc1
# Parent  045b2b8b522708093b91f883f1b7e7c1805f71e3
pygrub: Correct pygrub return value

This is the patch to correct pygrub return value for checkPassword()
function. It didn't return False at the end of the function. It
returned None so it was working fine and it's most likely just a
cosmetic issue.

Also, the missing () were added to checkPassword() function when
calling hasPassword and the unnecessary comment was removed.

Signed-off-by: Michal Novotny <minovotn@xxxxxxxxxx>
 tools/pygrub/src/GrubConf.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff -r 045b2b8b5227 -r 67f1b8b32585 tools/pygrub/src/GrubConf.py
--- a/tools/pygrub/src/GrubConf.py      Tue Sep 15 09:20:47 2009 +0100
+++ b/tools/pygrub/src/GrubConf.py      Tue Sep 15 09:21:34 2009 +0100
@@ -220,10 +220,9 @@ class GrubConfigFile(object):
     def checkPassword(self, password):
         # Always allow if no password defined in grub.conf
-        if not self.hasPassword:
+        if not self.hasPassword():
             return True
-        # If we're here, we're having 'password' attribute set
         pwd = getattr(self, 'password').split()
         # We check whether password is in MD5 hash for comparison
@@ -239,6 +238,8 @@ class GrubConfigFile(object):
         # ... and if not, we compare it as a plain text
         if pwd[0] == password:
             return True
+        return False
     def set(self, line):
         (com, arg) = grub_exact_split(line, 2)

Xen-changelog mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] pygrub: Correct pygrub return value, Xen patchbot-unstable <=