diff options
-rwxr-xr-x | src/lib/Bcfg2/Client/Tools/rpmtools.py | 23 | ||||
-rw-r--r-- | src/lib/Bcfg2/Options.py | 5 | ||||
-rw-r--r-- | src/lib/Bcfg2/Server/Admin/Bundle.py | 1 | ||||
-rw-r--r-- | src/lib/Bcfg2/Server/Admin/Pull.py | 1 | ||||
-rw-r--r-- | src/lib/Bcfg2/Server/Hostbase/backends.py | 5 | ||||
-rw-r--r-- | src/lib/Bcfg2/Server/Hostbase/ldapauth.py | 1 | ||||
-rwxr-xr-x | src/lib/Bcfg2/Server/Reports/importscript.py | 2 | ||||
-rwxr-xr-x | tools/accounts2xml.py | 4 | ||||
-rwxr-xr-x | tools/bcfg2-profile-templates.py | 4 | ||||
-rwxr-xr-x | tools/bcfg2_svnlog.py | 2 | ||||
-rwxr-xr-x | tools/export.py | 28 | ||||
-rwxr-xr-x | tools/selinux_baseline.py | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | tools/yum-listpkgs-xml.py | 1 |
13 files changed, 24 insertions, 55 deletions
diff --git a/src/lib/Bcfg2/Client/Tools/rpmtools.py b/src/lib/Bcfg2/Client/Tools/rpmtools.py index 7441b2c06..32a04262d 100755 --- a/src/lib/Bcfg2/Client/Tools/rpmtools.py +++ b/src/lib/Bcfg2/Client/Tools/rpmtools.py @@ -43,7 +43,6 @@ try: isprelink_imported = True except ImportError: isprelink_imported = False - #print '*********************** isprelink not loaded ***********************' # If the prelink command is installed on the system then we need to do # prelink -y on files. @@ -333,7 +332,6 @@ def prelink_size_check(filename): fsize += len(data) elif whitelist_re.search(filename) and not blacklist_re.search(filename): - # print "***** Warning isprelink extension failed to import ******" plf.close() cmd = '/usr/sbin/prelink -y %s 2> /dev/null' \ % (re.escape(filename)) @@ -601,7 +599,6 @@ def rpm_verify_package(vp_ts, header, verify_options): omitmask |= VERIFY_RDEV omitmask = ((~omitmask & VERIFY_ATTRS) ^ VERIFY_ATTRS) - #print 'omitmask =', omitmask package_results = {} @@ -754,58 +751,41 @@ class Rpmtscallback(object): """ if reason == rpm.RPMCALLBACK_INST_OPEN_FILE: pass - #print 'rpm.RPMCALLBACK_INST_OPEN_FILE' elif reason == rpm.RPMCALLBACK_INST_CLOSE_FILE: pass - #print 'rpm.RPMCALLBACK_INST_CLOSE_FILE' elif reason == rpm.RPMCALLBACK_INST_START: pass - #print 'rpm.RPMCALLBACK_INST_START' elif reason == rpm.RPMCALLBACK_TRANS_PROGRESS or \ reason == rpm.RPMCALLBACK_INST_PROGRESS: pass - #print 'rpm.RPMCALLBACK_TRANS_PROGRESS or \ # rpm.RPMCALLBACK_INST_PROGRESS' elif reason == rpm.RPMCALLBACK_TRANS_START: pass - #print 'rpm.RPMCALLBACK_TRANS_START' elif reason == rpm.RPMCALLBACK_TRANS_STOP: pass - #print 'rpm.RPMCALLBACK_TRANS_STOP' elif reason == rpm.RPMCALLBACK_REPACKAGE_START: pass - #print 'rpm.RPMCALLBACK_REPACKAGE_START' elif reason == rpm.RPMCALLBACK_REPACKAGE_PROGRESS: pass - #print 'rpm.RPMCALLBACK_REPACKAGE_PROGRESS' elif reason == rpm.RPMCALLBACK_REPACKAGE_STOP: pass - #print 'rpm.RPMCALLBACK_REPACKAGE_STOP' elif reason == rpm.RPMCALLBACK_UNINST_PROGRESS: pass - #print 'rpm.RPMCALLBACK_UNINST_PROGRESS' elif reason == rpm.RPMCALLBACK_UNINST_START: pass - #print 'rpm.RPMCALLBACK_UNINST_START' elif reason == rpm.RPMCALLBACK_UNINST_STOP: pass - #print 'rpm.RPMCALLBACK_UNINST_STOP' - #print '***Package ', key, ' deleted ***' # How do we get at this? # RPM.modified += key elif reason == rpm.RPMCALLBACK_UNPACK_ERROR: pass - #print 'rpm.RPMCALLBACK_UNPACK_ERROR' elif reason == rpm.RPMCALLBACK_CPIO_ERROR: pass - #print 'rpm.RPMCALLBACK_CPIO_ERROR' elif reason == rpm.RPMCALLBACK_UNKNOWN: pass - #print 'rpm.RPMCALLBACK_UNKNOWN' else: print('ERROR - Fell through callBack') - #print reason, amount, total, key, client_data def rpm_erase(erase_pkgspecs, erase_flags): """ @@ -836,7 +816,6 @@ def rpm_erase(erase_pkgspecs, erase_flags): erase_ts.addErase(idx) #for te in erase_ts: - # print "%s %s:%s-%s.%s" % (te.N(), te.E(), te.V(), te.R(), te.A()) erase_problems = [] if 'nodeps' not in erase_flags: @@ -847,8 +826,6 @@ def rpm_erase(erase_pkgspecs, erase_flags): erase_callback = Rpmtscallback() erase_ts.run(erase_callback.callback, 'Erase') #else: - # print 'ERROR - Dependency failures on package erase' - # print erase_problems erase_ts.closeDB() del erase_ts diff --git a/src/lib/Bcfg2/Options.py b/src/lib/Bcfg2/Options.py index 2ca465a4f..edebd10b3 100644 --- a/src/lib/Bcfg2/Options.py +++ b/src/lib/Bcfg2/Options.py @@ -140,8 +140,9 @@ class Option(object): if self.deprecated_cf: try: self.value = self.get_cooked_value(configparser.get(*self.deprecated_cf)) - print "Warning: [%s] %s is deprecated, use [%s] %s instead" % \ - (self.deprecated_cf[0], self.deprecated_cf[1], self.cf[0], self.cf[1]) + print("Warning: [%s] %s is deprecated, use [%s] %s instead" + % (self.deprecated_cf[0], self.deprecated_cf[1], + self.cf[0], self.cf[1])) return except (ConfigParser.NoSectionError, ConfigParser.NoOptionError): pass diff --git a/src/lib/Bcfg2/Server/Admin/Bundle.py b/src/lib/Bcfg2/Server/Admin/Bundle.py index ab07e29b3..49e530b15 100644 --- a/src/lib/Bcfg2/Server/Admin/Bundle.py +++ b/src/lib/Bcfg2/Server/Admin/Bundle.py @@ -50,7 +50,6 @@ class Bundle(Bcfg2.Server.Admin.MetadataCore): bundle_name = [] bundle_list = xml_list + genshi_list for bundle_path in bundle_list: - print "matching %s" % bundle_path bundle_name.append(rg.search(bundle_path).group(1)) text = "Available bundles (Number of bundles: %s)" % \ (len(bundle_list)) diff --git a/src/lib/Bcfg2/Server/Admin/Pull.py b/src/lib/Bcfg2/Server/Admin/Pull.py index 70984c57d..64327e018 100644 --- a/src/lib/Bcfg2/Server/Admin/Pull.py +++ b/src/lib/Bcfg2/Server/Admin/Pull.py @@ -93,7 +93,6 @@ class Pull(Bcfg2.Server.Admin.MetadataCore): for k, v in list(data.items()): if v: new_entry[k] = v - #print new_entry return new_entry def Choose(self, choices): diff --git a/src/lib/Bcfg2/Server/Hostbase/backends.py b/src/lib/Bcfg2/Server/Hostbase/backends.py index ecaf3c109..cfa9e1e16 100644 --- a/src/lib/Bcfg2/Server/Hostbase/backends.py +++ b/src/lib/Bcfg2/Server/Hostbase/backends.py @@ -18,21 +18,16 @@ from nisauth import * ## uid=l.badge_no ## ) ## #fixme: need to add this user session obj to session -## #print str(ldap_user) ## user,created = User.objects.get_or_create(username=username) -## #print user -## #print "created " + str(created) ## return user ## except LDAPAUTHError,e: -## #print str(e) ## return None ## def get_user(self,user_id): ## try: ## return User.objects.get(pk=user_id) ## except User.DoesNotExist, e: -## print str(e) ## return None diff --git a/src/lib/Bcfg2/Server/Hostbase/ldapauth.py b/src/lib/Bcfg2/Server/Hostbase/ldapauth.py index f3db26f67..fc2ca1bf1 100644 --- a/src/lib/Bcfg2/Server/Hostbase/ldapauth.py +++ b/src/lib/Bcfg2/Server/Hostbase/ldapauth.py @@ -144,7 +144,6 @@ class ldapauth(object): def member_of(self): """See if this user is in our group that is allowed to login""" m = [g for g in self.memberOf if g == self.check_member_of] - #print m if len(m) == 1: return True else: diff --git a/src/lib/Bcfg2/Server/Reports/importscript.py b/src/lib/Bcfg2/Server/Reports/importscript.py index 289970244..3cc643da1 100755 --- a/src/lib/Bcfg2/Server/Reports/importscript.py +++ b/src/lib/Bcfg2/Server/Reports/importscript.py @@ -286,7 +286,7 @@ if __name__ == '__main__': if o in ("-d", "--debug"): verb = 3 if o in ("-c", "--clients"): - print "DeprecationWarning: %s is no longer used" % o + print("DeprecationWarning: %s is no longer used" % o) if o in ("-s", "--stats"): statpath = a diff --git a/tools/accounts2xml.py b/tools/accounts2xml.py index de41c6107..0f7624f7d 100755 --- a/tools/accounts2xml.py +++ b/tools/accounts2xml.py @@ -71,7 +71,7 @@ def main(args): with file(filename, 'w') as modified: modified.write("name:pass:uid:gid:gecos:home:shell\n" + data); modified.close() safe_filename = "Properties" except IndexError: - print "ERROR: Please provide a filename.csv as the first argument" + print("ERROR: Please provide a filename.csv as the first argument") sys.exit() node_user = "UnixUser" @@ -107,7 +107,7 @@ def main(args): output_file = "accounts.xml" doc.writexml(open(output_file, 'w'), addindent=' ', newl='\n') # Write file - print "Done: Created %s" % output_file + print("Done: Created %s" % output_file) os.remove(filename) def create_col_nodes(cols, item, doc, row): diff --git a/tools/bcfg2-profile-templates.py b/tools/bcfg2-profile-templates.py index 1cecc0274..d60d7584a 100755 --- a/tools/bcfg2-profile-templates.py +++ b/tools/bcfg2-profile-templates.py @@ -120,9 +120,9 @@ def main(): continue if avg > 0.01 or templates: tmpltimes.append((tmpl, avg)) - print "%-50s %s" % ("Template", "Average Render Time") + print("%-50s %s" % ("Template", "Average Render Time")) for tmpl, avg in reversed(sorted(tmpltimes, key=operator.itemgetter(1))): - print "%-50s %.02f" % (tmpl, avg) + print("%-50s %.02f" % (tmpl, avg)) # TODO: complain about templates that on average were quick but # for which some clients were slow diff --git a/tools/bcfg2_svnlog.py b/tools/bcfg2_svnlog.py index af0624788..5a03bf993 100755 --- a/tools/bcfg2_svnlog.py +++ b/tools/bcfg2_svnlog.py @@ -468,7 +468,7 @@ def main(): smtp.sendmail(msg['From'], [msg['To']], msg.as_string()) smtp.quit() else: - print "\n".join(body) + print("\n".join(body)) if __name__ == "__main__": sys.exit(main()) diff --git a/tools/export.py b/tools/export.py index e4f16330d..16229e209 100755 --- a/tools/export.py +++ b/tools/export.py @@ -39,7 +39,7 @@ def run(command): def find_and_replace(f, iftest, rline, startswith=False, dryrun=False): if dryrun: inplace = 0 - print "*** dry-run: New '%s' will look like this:" % f + print("*** dry-run: New '%s' will look like this:" % f) else: inplace = 1 for line in fileinput.input(f, inplace): @@ -52,7 +52,7 @@ def find_and_replace(f, iftest, rline, startswith=False, dryrun=False): line = line.replace(line, rline) sys.stdout.write(line) if dryrun: - print "*** End '%s'" % f + print("*** End '%s'" % f) def main(): @@ -87,8 +87,8 @@ def main(): options = p.parse_args()[0] if options.debug: - print options - print "What should debug mode do?" + print(options) + print("What should debug mode do?") # py3k compatibility try: @@ -113,9 +113,9 @@ def main(): version_info['micro']) if options.debug: - print "version is %s" % version - print "version_info is %s" % version_info - print "version_release is %s" % version_release + print("version is %s" % version) + print("version_info is %s" % version_info) + print("version_release is %s" % version_release) if not version_info["major"].isdigit() \ or not version_info["minor"].isdigit() \ @@ -126,11 +126,11 @@ def main(): 'IFMinorVersion restrictions in ' 'Mac OS X Packaging') except: - print """Version must be of the form Major.Minor.MicroBuild, + print("""Version must be of the form Major.Minor.MicroBuild, where Major and Minor are integers and Micro is a single digit optionally followed by Build (i.e. pre##) E.G. 1.2.0pre1 is a valid version. -""" +""") quit() tarname = '/tmp/%s-%s.tar.gz' % (pkgname, version) @@ -160,8 +160,8 @@ E.G. 1.2.0pre1 is a valid version. f.write(newchangelog + old) f.close() except: - print "Problem opening debian/changelog" - print help_message + print("Problem opening debian/changelog") + print(help_message) quit() # Update redhat directory versions @@ -266,13 +266,13 @@ E.G. 1.2.0pre1 is a valid version. if options.dryrun: for cmd in commando_orders: - print "*** dry-run: %s" % commando[cmd] + print("*** dry-run: %s" % commando[cmd]) else: for cmd in commando_orders: output = run(commando[cmd])[0].strip() if options.verbose: - print output - print "Ran '%s' with above output." % cmd + print(output) + print("Ran '%s' with above output." % cmd) if __name__ == '__main__': sys.exit(main()) diff --git a/tools/selinux_baseline.py b/tools/selinux_baseline.py index 6ddc390a3..b6997bb29 100755 --- a/tools/selinux_baseline.py +++ b/tools/selinux_baseline.py @@ -45,7 +45,7 @@ def main(): entry.tag = "BoundSELinux" baseline.extend(extra) - print lxml.etree.tostring(baseline, pretty_print=True) + print(lxml.etree.tostring(baseline, pretty_print=True)) if __name__ == "__main__": sys.exit(main()) diff --git a/tools/yum-listpkgs-xml.py b/tools/yum-listpkgs-xml.py index 2df5abbcd..a052e75af 100644..100755 --- a/tools/yum-listpkgs-xml.py +++ b/tools/yum-listpkgs-xml.py @@ -19,7 +19,6 @@ def myListPkgs(self, lst, description, outputType): thingslisted = 0 if len(lst) > 0: thingslisted = 1 - #print '%s' % description from yum.misc import sortPkgObj lst.sort(sortPkgObj) for pkg in lst: |