summaryrefslogtreecommitdiffstats
path: root/ipa-admintools
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2007-11-30 12:04:16 -0500
committerRob Crittenden <rcritten@redhat.com>2007-11-30 12:04:16 -0500
commit72595ab1a50926fec23597b31db0dce31de6e5ff (patch)
tree647e22ab6ebbd362fc2c61727b01e4a33b92e527 /ipa-admintools
parent5025e990e930161160b3f2dc7610a15b3484ed24 (diff)
downloadfreeipa-72595ab1a50926fec23597b31db0dce31de6e5ff.tar.gz
freeipa-72595ab1a50926fec23597b31db0dce31de6e5ff.tar.xz
freeipa-72595ab1a50926fec23597b31db0dce31de6e5ff.zip
delete_group() takes a DN, not a CN. Also do slightly better error reporting.
Diffstat (limited to 'ipa-admintools')
-rw-r--r--ipa-admintools/ipa-delgroup14
1 files changed, 13 insertions, 1 deletions
diff --git a/ipa-admintools/ipa-delgroup b/ipa-admintools/ipa-delgroup
index b4f946065..ec911085d 100644
--- a/ipa-admintools/ipa-delgroup
+++ b/ipa-admintools/ipa-delgroup
@@ -50,7 +50,19 @@ def main():
try:
client = ipaclient.IPAClient()
- ret = client.delete_group(args[1])
+ groups = client.find_groups(args[1], ['cn','description','gidnumber','nsAccountLock'])
+
+ counter = groups[0]
+ groups = groups[1:]
+
+ if counter == 0:
+ print "Group '%s' not found." % args[1]
+ return 2
+ if counter != 1:
+ print "An exact group match was not found. Found %d groups" % counter
+ return 2
+
+ ret = client.delete_group(groups[0].dn)
if (ret == "Success"):
print args[1] + " successfully deleted"
else: