help="remove the group home folder") parser.add_option("-b", "--backup", action="store_true", dest="backup", default=False, help="backup the group home folder") (options, args) = parser.parse_args() if len(args)<2: print "Missing group name for creategroup operation" exit(0) groupname = args[1] print "Group name: %s" % groupname gm = GroupManager() try: groupdel_res = gm.removegroup(groupname,options.backup,options.remove) except Exception, e: print "An error occured while writing to the user LDAP database" print e exit(0) if groupdel_res==-1: print "The group %s does not exist" % groupname exit(0) if groupdel_res==-2: print "A problem occurred while creating a backup of the group's home folder." exit(0) if groupdel_res==-3: print "A problem occurred while removing the group's home folder." exit(0) print "Group removed..."