diff options
Diffstat (limited to 'ipa-admintools/ipa-delradiusprofile')
-rw-r--r-- | ipa-admintools/ipa-delradiusprofile | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ipa-admintools/ipa-delradiusprofile b/ipa-admintools/ipa-delradiusprofile index 16baea4ab..f77d01747 100644 --- a/ipa-admintools/ipa-delradiusprofile +++ b/ipa-admintools/ipa-delradiusprofile @@ -42,6 +42,8 @@ def help_option_callback(option, opt_str, value, parser, *args, **kwargs): def main(): opt_parser = OptionParser(add_help_option=False) + opt_parser.add_option("-s", "--shared", dest="shared", default=False, action='store_true', + help="profile is shared") opt_parser.add_option("-h", "--help", action="callback", callback=help_option_callback, help="detailed help information") opt_parser.set_usage("Usage: %s [options] UID" % (os.path.basename(sys.argv[0]))) @@ -53,10 +55,16 @@ def main(): opt_parser.error("missing UID") uid = args[1] + user_profile = not options.shared + + # Per user profiles are pre-created (i.e. objectclass radiusprofile is always added for each user) + if user_profile: + print "ERROR, you cannot delete a per-user radius profile, it always exists" + return 1 try: ipa_client = ipaclient.IPAClient() - ipa_client.delete_radius_profile(uid) + ipa_client.delete_radius_profile(uid, user_profile) print "successfully deleted" except xmlrpclib.Fault, f: print f.faultString |