summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-08-15 08:21:19 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-08-15 08:21:19 -0400
commite911b57eb38dfa0fc06d19e70e02e121ae721e57 (patch)
tree350c41f512f831d48bd538c84e64fc714fe760d1
parent8207c9c78a94d316bfbd582b2672796e488319b5 (diff)
downloadbcfg2-e911b57eb38dfa0fc06d19e70e02e121ae721e57.tar.gz
bcfg2-e911b57eb38dfa0fc06d19e70e02e121ae721e57.tar.bz2
bcfg2-e911b57eb38dfa0fc06d19e70e02e121ae721e57.zip
print function fixes
-rw-r--r--src/lib/Bcfg2/Server/Admin/Reports.py4
-rw-r--r--src/lib/Bcfg2/Server/Admin/Syncdb.py2
-rw-r--r--src/lib/Bcfg2/Server/Plugins/FileProbes.py4
-rwxr-xr-xsrc/sbin/bcfg2-info2
-rwxr-xr-xsrc/sbin/bcfg2-yum-helper16
-rw-r--r--testsuite/Testlib/TestOptions.py1
6 files changed, 14 insertions, 15 deletions
diff --git a/src/lib/Bcfg2/Server/Admin/Reports.py b/src/lib/Bcfg2/Server/Admin/Reports.py
index 175b99d1d..335d6a1e7 100644
--- a/src/lib/Bcfg2/Server/Admin/Reports.py
+++ b/src/lib/Bcfg2/Server/Admin/Reports.py
@@ -109,7 +109,7 @@ class Reports(Bcfg2.Server.Admin.Mode):
try:
update_database()
except UpdaterError:
- print "Update failed"
+ print("Update failed")
raise SystemExit(-1)
elif args[0] == 'load_stats':
quick = '-O3' in args
@@ -121,7 +121,7 @@ class Reports(Bcfg2.Server.Admin.Mode):
if stats_file[0] == '-':
self.errExit("Invalid statistics file: %s" % stats_file)
elif args[i] == '-c' or args[i] == '--clients-file':
- print "DeprecationWarning: %s is no longer used" % args[i]
+ print("DeprecationWarning: %s is no longer used" % args[i])
i = i + 1
self.load_stats(stats_file, self.log.getEffectiveLevel() > logging.WARNING, quick)
elif args[0] == 'purge':
diff --git a/src/lib/Bcfg2/Server/Admin/Syncdb.py b/src/lib/Bcfg2/Server/Admin/Syncdb.py
index c9bba0810..72d3d469e 100644
--- a/src/lib/Bcfg2/Server/Admin/Syncdb.py
+++ b/src/lib/Bcfg2/Server/Admin/Syncdb.py
@@ -35,5 +35,5 @@ class Syncdb(Bcfg2.Server.Admin.Mode):
try:
update_database()
except UpdaterError:
- print "Update failed"
+ print("Update failed")
raise SystemExit(-1)
diff --git a/src/lib/Bcfg2/Server/Plugins/FileProbes.py b/src/lib/Bcfg2/Server/Plugins/FileProbes.py
index f95c05d42..a403c78d7 100644
--- a/src/lib/Bcfg2/Server/Plugins/FileProbes.py
+++ b/src/lib/Bcfg2/Server/Plugins/FileProbes.py
@@ -24,7 +24,7 @@ import lxml.etree
path = "%s"
if not os.path.exists(path):
- print "%%s does not exist" %% path
+ print("%%s does not exist" %% path)
raise SystemExit(1)
stat = os.stat(path)
@@ -34,7 +34,7 @@ data = lxml.etree.Element("ProbedFileData",
group=grp.getgrgid(stat[5])[0],
perms=oct(stat[0] & 07777))
data.text = binascii.b2a_base64(open(path).read())
-print lxml.etree.tostring(data)
+print(lxml.etree.tostring(data))
"""
class FileProbes(Bcfg2.Server.Plugin.Plugin,
diff --git a/src/sbin/bcfg2-info b/src/sbin/bcfg2-info
index 28f4d17ac..f3b2aec10 100755
--- a/src/sbin/bcfg2-info
+++ b/src/sbin/bcfg2-info
@@ -643,7 +643,7 @@ class infoCore(cmd.Cmd, Bcfg2.Server.Core.BaseCore):
print("Unable to build metadata for host %s" % args)
return
collection = self.plugins['Packages']._get_collection(metadata)
- print collection.sourcelist()
+ print(collection.sourcelist())
def do_profile(self, arg):
"""."""
diff --git a/src/sbin/bcfg2-yum-helper b/src/sbin/bcfg2-yum-helper
index 53784518b..a0698cc90 100755
--- a/src/sbin/bcfg2-yum-helper
+++ b/src/sbin/bcfg2-yum-helper
@@ -286,27 +286,27 @@ def main():
depsolver = DepSolver(options.config, options.verbose)
if cmd == "clean":
depsolver.clean_cache()
- print json.dumps(True)
+ print(json.dumps(True))
elif cmd == "complete":
data = json.loads(sys.stdin.read())
depsolver.groups = data['groups']
(packages, unknown) = depsolver.complete([pkg_to_tuple(p)
for p in data['packages']])
- print json.dumps(dict(packages=list(packages),
- unknown=list(unknown)))
+ print(json.dumps(dict(packages=list(packages),
+ unknown=list(unknown))))
elif cmd == "is_virtual_package":
package = pkg_to_tuple(json.loads(sys.stdin.read()))
- print json.dumps(bool(depsolver.get_provides(package, silent=True)))
+ print(json.dumps(bool(depsolver.get_provides(package, silent=True))))
elif cmd == "get_deps" or cmd == "get_provides":
package = pkg_to_tuple(json.loads(sys.stdin.read()))
- print json.dumps([p.name for p in getattr(depsolver, cmd)(package)])
+ print(json.dumps([p.name for p in getattr(depsolver, cmd)(package)]))
elif cmd == "get_group":
data = json.loads(sys.stdin.read())
if "type" in data:
packages = depsolver.get_group(data['group'], ptype=data['type'])
else:
packages = depsolver.get_group(data['group'])
- print json.dumps(list(packages))
+ print(json.dumps(list(packages)))
elif cmd == "get_groups":
data = json.loads(sys.stdin.read())
rv = dict()
@@ -317,10 +317,10 @@ def main():
else:
packages = depsolver.get_group(gdata['group'])
rv[gdata['group']] = list(packages)
- print json.dumps(rv)
+ print(json.dumps(rv))
elif cmd == "is_package":
package = pkg_to_tuple(json.loads(sys.stdin.read()))
- print json.dumps(getattr(depsolver, cmd)(package))
+ print(json.dumps(getattr(depsolver, cmd)(package)))
if __name__ == '__main__':
diff --git a/testsuite/Testlib/TestOptions.py b/testsuite/Testlib/TestOptions.py
index 4c87b2f42..e3bba787d 100644
--- a/testsuite/Testlib/TestOptions.py
+++ b/testsuite/Testlib/TestOptions.py
@@ -30,7 +30,6 @@ class TestOption(Bcfg2TestCase):
c.get('foo', False, cmd='-f')
mock_cp.assert_any_call()
mock_open.assert_any_call(Bcfg2.Options.DEFAULT_CONFIG_LOCATION)
- print(mock_cp.return_value.get.called)
self.assertTrue(mock_cp.return_value.get.called)
@patch('Bcfg2.Options.DefaultConfigParser')