diff options
author | Sol Jerome <sol.jerome@gmail.com> | 2011-04-04 09:24:37 -0500 |
---|---|---|
committer | Sol Jerome <sol.jerome@gmail.com> | 2011-04-06 19:35:21 -0500 |
commit | 8f4a2394638912b000682e2211723e4a644915e1 (patch) | |
tree | dcc8bfe8939154ade2c2f4be99758f0f441698d4 | |
parent | 50d489f38e18577cb7e75605515d4b8d567aaa52 (diff) | |
download | bcfg2-8f4a2394638912b000682e2211723e4a644915e1.tar.gz bcfg2-8f4a2394638912b000682e2211723e4a644915e1.tar.bz2 bcfg2-8f4a2394638912b000682e2211723e4a644915e1.zip |
tools: Fixes from a second 2to3 run
Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
-rwxr-xr-x | tools/export.py | 15 | ||||
-rwxr-xr-x | tools/pkgmgr_gen.py | 2 | ||||
-rw-r--r-- | tools/rpmlisting.py | 2 |
3 files changed, 14 insertions, 5 deletions
diff --git a/tools/export.py b/tools/export.py index 2d8d38e20..5e48a3613 100755 --- a/tools/export.py +++ b/tools/export.py @@ -12,7 +12,11 @@ import sys pkgname = 'bcfg2' ftphost = 'terra.mcs.anl.gov' ftpdir = '/mcs/ftp/pub/bcfg' -version = input("Please enter the version you are tagging (e.g. 1.0.0): ") +# py3k compatibility +try: + version = raw_input("Please enter the version you are tagging (e.g. 1.0.0): ") +except NameError: + version = input("Please enter the version you are tagging (e.g. 1.0.0): ") tarname = '/tmp/%s-%s.tar.gz' % (pkgname, version) @@ -22,8 +26,13 @@ def run(command): # update the version majorver = version[:5] minorver = version[5:] -name = input("Your name: ") -email = input("Your email: ") +# py3k compatibility +try: + name = raw_input("Your name: ") + email = raw_input("Your email: ") +except NameError: + name = input("Your name: ") + email = input("Your email: ") newchangelog = \ """bcfg2 (%s-0.0%s) unstable; urgency=low diff --git a/tools/pkgmgr_gen.py b/tools/pkgmgr_gen.py index cc7ab3a4c..9ce15b8c3 100755 --- a/tools/pkgmgr_gen.py +++ b/tools/pkgmgr_gen.py @@ -362,7 +362,7 @@ def printPackage(entry, group_count): arch_dict[subarch_mapping[instance['arch']]] = [instance['arch']] # Only keep the 'highest' subarchitecture in each architecture. - for arch in arch_dict.keys(): + for arch in list(arch_dict.keys()): if len(arch_dict[arch]) > 1: arch_dict[arch].sort() for s in arch_dict[arch][:-1]: diff --git a/tools/rpmlisting.py b/tools/rpmlisting.py index afc9ebed5..141cae172 100644 --- a/tools/rpmlisting.py +++ b/tools/rpmlisting.py @@ -150,7 +150,7 @@ def parse_rpm_filename(path, filename): (blob, subarch, extension) = (rblob[::-1], rsubarch[::-1], rextension[::-1]) (rrelease, rversion, rname) = blob[::-1].split('-', 2) (name, version, release) = (rname[::-1], rversion[::-1], rrelease[::-1]) - if subarch not in subarch_mapping.keys(): + if subarch not in list(subarch_mapping.keys()): raise "%s/%s has invalid subarch %s." % (path, filename, subarch) except: # for incorrectly named rpms (ie, sun's java rpms) we fall back to reading the rpm headers. |