exit(0) parser.set_usage("usage: %s %s [options] groupname" % (shell_cmd_name,cmd)) parser.add_option("-d", "--description", dest="description",default=None, help="Change the groups description", metavar="DESCRIPTION") (options, args) = parser.parse_args() if len(args)<2: print "Missing group name for changegroup operation" exit(0) groupname = args[1] print "Group name: %s" % groupname gm = GroupManager() try: changegrp_res = gm.changegroup(groupname,options.description) except Exception, e: print "An error occured while writing to the user LDAP database" print e exit(0) if changegrp_res==-1: print 'The group "%s" does not exist' % groupname if cmd == "removegroup": if os.getuid()!=0: print "You must be root to remove groups" exit(0) parser.set_usage("usage: %s %s [options] groupname" % (shell_cmd_name,cmd))