summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Admin/Group.py
diff options
context:
space:
mode:
authorSol Jerome <sol.jerome@gmail.com>2011-04-06 19:34:30 -0500
committerSol Jerome <sol.jerome@gmail.com>2011-04-06 19:35:21 -0500
commit742fc83dcdb82639b97723ce4cbfade75fb1aa71 (patch)
tree3c242e7029ab20f03300292d272e665c33c17943 /src/lib/Server/Admin/Group.py
parente17608a61575ec9d50cfed34a80540257254840b (diff)
downloadbcfg2-742fc83dcdb82639b97723ce4cbfade75fb1aa71.tar.gz
bcfg2-742fc83dcdb82639b97723ce4cbfade75fb1aa71.tar.bz2
bcfg2-742fc83dcdb82639b97723ce4cbfade75fb1aa71.zip
bcfg2-admin: PY3K + PEP8 fixes
Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
Diffstat (limited to 'src/lib/Server/Admin/Group.py')
-rw-r--r--src/lib/Server/Admin/Group.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/lib/Server/Admin/Group.py b/src/lib/Server/Admin/Group.py
index 4b2db28ec..1c5d0c12f 100644
--- a/src/lib/Server/Admin/Group.py
+++ b/src/lib/Server/Admin/Group.py
@@ -2,6 +2,7 @@ import lxml.etree
import Bcfg2.Server.Admin
from Bcfg2.Server.Plugins.Metadata import MetadataConsistencyError
+
class Group(Bcfg2.Server.Admin.MetadataCore):
__shorthelp__ = "Create, delete, or modify group entries"
__longhelp__ = (__shorthelp__ + "\n\nbcfg2-admin group add <group> "
@@ -28,13 +29,13 @@ class Group(Bcfg2.Server.Admin.MetadataCore):
if attr not in ['profile', 'public', 'default',
'name', 'auth', 'toolset', 'category',
'comment']:
- print "Attribute %s unknown" % attr
+ print("Attribute %s unknown" % attr)
raise SystemExit(1)
attr_d[attr] = val
try:
self.metadata.add_group(args[1], attr_d)
except MetadataConsistencyError:
- print "Error in adding group"
+ print("Error in adding group")
raise SystemExit(1)
elif args[0] in ['update', 'up']:
attr_d = {}
@@ -43,24 +44,24 @@ class Group(Bcfg2.Server.Admin.MetadataCore):
if attr not in ['profile', 'public', 'default',
'name', 'auth', 'toolset', 'category',
'comment']:
- print "Attribute %s unknown" % attr
+ print("Attribute %s unknown" % attr)
raise SystemExit(1)
attr_d[attr] = val
try:
self.metadata.update_group(args[1], attr_d)
except MetadataConsistencyError:
- print "Error in updating group"
+ print("Error in updating group")
raise SystemExit(1)
elif args[0] in ['delete', 'remove', 'del', 'rm']:
try:
self.metadata.remove_group(args[1])
except MetadataConsistencyError:
- print "Error in deleting group"
+ print("Error in deleting group")
raise SystemExit(1)
elif args[0] in ['list', 'ls']:
tree = lxml.etree.parse(self.metadata.data + "/groups.xml")
for node in tree.findall("//Group"):
- print node.attrib["name"]
+ print(node.attrib["name"])
else:
- print "No command specified"
+ print("No command specified")
raise SystemExit(1)