mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-01-02 12:16:56 -06:00
delete_group() takes a DN, not a CN. Also do slightly better error reporting.
This commit is contained in:
parent
5025e990e9
commit
72595ab1a5
@ -50,7 +50,19 @@ def main():
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
client = ipaclient.IPAClient()
|
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"):
|
if (ret == "Success"):
|
||||||
print args[1] + " successfully deleted"
|
print args[1] + " successfully deleted"
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user