Incorrect accquiring bugdir command line argument master
authorMatěj Cepl <mcepl@redhat.com>
Thu, 31 Oct 2013 17:46:09 +0000 (18:46 +0100)
committerW. Trevor King <wking@tremily.us>
Thu, 31 Oct 2013 20:26:01 +0000 (13:26 -0700)
The calling below seems like a typo to me. How can we index with
a variable which has not been initialized yet?

libbe/command/new.py
libbe/command/set.py
libbe/command/target.py

index 6e94e79b5ca24f1dd7c5e2eeab216ee1f3bcdca2..33ede500b53ea152d311322dd57bc6fac39038a0 100644 (file)
@@ -118,7 +118,7 @@ class New (libbe.command.Command):
         storage = self._get_storage()
         bugdirs = self._get_bugdirs()
         if params['bugdir']:
-            bugdir = bugdirs[bugdir]
+            bugdir = bugdirs[params['bugdir']]
         elif len(bugdirs) == 1:
             bugdir = bugdirs.values()[0]
         else:
index 9413a13b9a1b20b5dd7834ca9d799e5f70d47550..d5528783803437a36ca6bcf2c69a312f2c127542 100644 (file)
@@ -77,7 +77,7 @@ class Set (libbe.command.Command):
     def _run(self, **params):
         bugdirs = self._get_bugdirs()
         if params['bugdir']:
-            bugdir = bugdirs[bugdir]
+            bugdir = bugdirs[params['bugdir']]
         elif len(bugdirs) == 1:
             bugdir = bugdirs.values()[0]
         else:
index 20ffb578c1cbada8ecf5502ef5a6d337228749d2..9f763035300876ddda0d388f2c2bfe659169ef4e 100644 (file)
@@ -99,7 +99,7 @@ class Target (libbe.command.Command):
         bugdirs = self._get_bugdirs()
         if params['resolve'] == True:
             if params['bugdir']:
-                bugdir = bugdirs[bugdir]
+                bugdir = bugdirs[params['bugdir']]
             elif len(bugdirs) == 1:
                 bugdir = bugdirs.values()[0]
             else: