diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2009-09-15 09:21:34 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2009-09-15 09:21:34 +0100 |
commit | ada90ce49fb54ed7cd6ab569bb486c9c17ddad8c (patch) | |
tree | 3e84cc0e23a8ff6a4ab099f2c08a6b7de4e14a3b /tools/pygrub/src/GrubConf.py | |
parent | 278db12c2bf6d77d450a6d963294260b732d9154 (diff) | |
download | xen-ada90ce49fb54ed7cd6ab569bb486c9c17ddad8c.tar.gz xen-ada90ce49fb54ed7cd6ab569bb486c9c17ddad8c.tar.bz2 xen-ada90ce49fb54ed7cd6ab569bb486c9c17ddad8c.zip |
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@redhat.com>
Diffstat (limited to 'tools/pygrub/src/GrubConf.py')
-rw-r--r-- | tools/pygrub/src/GrubConf.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/pygrub/src/GrubConf.py b/tools/pygrub/src/GrubConf.py index 4aac8c189b..cfd75dbc48 100644 --- a/tools/pygrub/src/GrubConf.py +++ b/tools/pygrub/src/GrubConf.py @@ -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 @@ -240,6 +239,8 @@ class GrubConfigFile(object): if pwd[0] == password: return True + return False + def set(self, line): (com, arg) = grub_exact_split(line, 2) if self.commands.has_key(com): |