diff options
author | Karl MacMillan <kmacmill@redhat.com> | 2007-12-11 12:42:51 -0500 |
---|---|---|
committer | Karl MacMillan <kmacmill@redhat.com> | 2007-12-11 12:42:51 -0500 |
commit | ad3fcc200c88a5b4d5502c1f5415f72d293ae581 (patch) | |
tree | 19ceac36f79d7cdc874abbd7ca9c985bec957e63 /ipa-admintools | |
parent | d2378f13d0ce867175952346302d42c7a9a9fb2b (diff) | |
parent | ca8e71d9381fb61368e5666c4d560ae9417fdf97 (diff) | |
download | freeipa-ad3fcc200c88a5b4d5502c1f5415f72d293ae581.tar.gz freeipa-ad3fcc200c88a5b4d5502c1f5415f72d293ae581.tar.xz freeipa-ad3fcc200c88a5b4d5502c1f5415f72d293ae581.zip |
Merge.
Diffstat (limited to 'ipa-admintools')
-rw-r--r-- | ipa-admintools/ipa-addgroup | 16 | ||||
-rw-r--r-- | ipa-admintools/ipa-adduser | 34 | ||||
-rw-r--r-- | ipa-admintools/ipa-deldelegation | 4 | ||||
-rw-r--r-- | ipa-admintools/ipa-findgroup | 2 | ||||
-rw-r--r-- | ipa-admintools/ipa-finduser | 2 | ||||
-rw-r--r-- | ipa-admintools/ipa-usermod | 30 |
6 files changed, 45 insertions, 43 deletions
diff --git a/ipa-admintools/ipa-addgroup b/ipa-admintools/ipa-addgroup index 15d42a91e..8169dea12 100644 --- a/ipa-admintools/ipa-addgroup +++ b/ipa-admintools/ipa-addgroup @@ -62,28 +62,28 @@ def main(): if (len(args) != 2): while (cont != True): cn = raw_input("Group name: ") - if (ipavalidate.plain(cn, notEmpty=True)): - print "Field is required and must be letters or '." + if (ipavalidate.String(cn, notEmpty=True)): + print "Please enter a value" else: cont = True else: cn = args[1] - if (ipavalidate.plain(cn, notEmpty=True)): - print "Group name is required and must be letters or '." + if (ipavalidate.ipastsring(cn, notEmpty=True)): + print "Please enter a value" return 1 cont = False if not options.desc: while (cont != True): desc = raw_input("Description: ") - if (ipavalidate.plain(desc, notEmpty=True)): - print "Field is required and must be letters or '." + if (ipavalidate.String(desc, notEmpty=True)): + print "Please enter a value" else: cont = True else: desc = options.desc - if (ipavalidate.plain(desc, notEmpty=True)): - print "First name is required and must be letters or '." + if (ipavalidate.String(desc, notEmpty=True)): + print "Please enter a value" return 1 if options.gid: diff --git a/ipa-admintools/ipa-adduser b/ipa-admintools/ipa-adduser index 96b43e0d5..298834258 100644 --- a/ipa-admintools/ipa-adduser +++ b/ipa-admintools/ipa-adduser @@ -92,42 +92,42 @@ def main(): if not options.gn: while (cont != True): givenname = raw_input("First name: ") - if (ipavalidate.plain(givenname, notEmpty=True)): - print "Field is required and must be letters or '" + if (ipavalidate.String(givenname, notEmpty=True)): + print "Please enter a value" else: cont = True else: givenname = options.gn - if (ipavalidate.plain(givenname, notEmpty=True)): - print "First name is required and must be letters or '" + if (ipavalidate.String(givenname, notEmpty=True)): + print "Please enter a value" return 1 cont = False if not options.sn: while (cont != True): lastname = raw_input("Last name: ") - if (ipavalidate.plain(lastname, notEmpty=True)): - print "Field is required and must be letters or '" + if (ipavalidate.String(lastname, notEmpty=True)): + print "Please enter a value" else: cont = True else: lastname = options.sn - if (ipavalidate.plain(lastname, notEmpty=True)): - print "Last name is required and must be letters or '" + if (ipavalidate.String(lastname, notEmpty=True)): + print "Please enter a value" return 1 cont = False if (len(args) != 2): while (cont != True): username = raw_input("Login name: ") - if (ipavalidate.plain(username, notEmpty=True)): - print "Field is required and must be letters or '" + if (ipavalidate.Plain(username, notEmpty=True, allowSpaces=False)): + print "Please enter a value" else: cont = True else: username = args[1] - if (ipavalidate.plain(username, notEmpty=True)): - print "Username is required and must be letters or '" + if (ipavalidate.Plain(username, notEmpty=True, allowSpaces=False)): + print "Username is required and may only include letters and numbers" return 1 if not options.password: @@ -147,7 +147,7 @@ def main(): if options.mail: mail = options.mail - if (ipavalidate.email(mail)): + if (ipavalidate.Email(mail)): print "The email provided seem not a valid email." return 1 @@ -158,8 +158,8 @@ def main(): if not options.gecos: while (cont != True): gecos = raw_input("gecos []: ") - if (ipavalidate.plain(gecos, notEmpty=False)): - print "Must be letters, numbers, spaces or '" + if (ipavalidate.String(gecos, notEmpty=False)): + print "Please enter a value" else: cont = True cont = False @@ -168,8 +168,8 @@ def main(): directory = raw_input("home directory [/home/"+username+"]: ") if directory == "": directory = "/home/"+username - if (ipavalidate.path(directory, notEmpty=False)): - print "Must be letters, numbers, spaces or '" + if (ipavalidate.Path(directory, notEmpty=False)): + print "Please enter a value" else: cont = True cont = False diff --git a/ipa-admintools/ipa-deldelegation b/ipa-admintools/ipa-deldelegation index 7ad17c38b..030d462ff 100644 --- a/ipa-admintools/ipa-deldelegation +++ b/ipa-admintools/ipa-deldelegation @@ -65,6 +65,7 @@ def main(): if not(isinstance(aci_str_list,list) or isinstance(aci_str_list,tuple)): aci_str_list = [aci_str_list] + acistr = None for aci_str in aci_str_list: try: aci = ipa.aci.ACI(aci_str) @@ -76,7 +77,7 @@ def main(): pass if acistr is None: - print "No delegation %s found." % args[1] + print "No delegation '%s' found." % args[1] return 2 old_aci_index = aci_str_list.index(acistr) @@ -86,6 +87,7 @@ def main(): aci_entry.setValue('aci', new_aci_str_list) client.update_entry(aci_entry) + print "Delegation removed." except xmlrpclib.Fault, fault: if fault.faultCode == errno.ECONNREFUSED: print "The IPA XML-RPC service is not responding." diff --git a/ipa-admintools/ipa-findgroup b/ipa-admintools/ipa-findgroup index d84a2c62f..73b0bb1bc 100644 --- a/ipa-admintools/ipa-findgroup +++ b/ipa-admintools/ipa-findgroup @@ -67,7 +67,7 @@ def main(): return 2 elif counter == -1: print "These results are truncated." - print "Please revine your search and try again." + print "Please refine your search and try again." for ent in groups: try: diff --git a/ipa-admintools/ipa-finduser b/ipa-admintools/ipa-finduser index 81e8898a2..2ee19dfe0 100644 --- a/ipa-admintools/ipa-finduser +++ b/ipa-admintools/ipa-finduser @@ -92,7 +92,7 @@ def main(): return 2 elif counter == -1: print "These results are truncated." - print "Please revine your search and try again." + print "Please refine your search and try again." for ent in users: attr = ent.attrList() diff --git a/ipa-admintools/ipa-usermod b/ipa-admintools/ipa-usermod index 9d3e7794c..5d33700f9 100644 --- a/ipa-admintools/ipa-usermod +++ b/ipa-admintools/ipa-usermod @@ -124,8 +124,8 @@ def main(): if not options.gn: while (cont != True): givenname = raw_input("First name: [%s] " % user.getValue('givenname')) - if (ipavalidate.plain(givenname, notEmpty=False)): - print "Must be letters or '" + if (ipavalidate.String(givenname, notEmpty=False)): + print "Please enter a value" else: cont = True if len(givenname) < 1: @@ -133,16 +133,16 @@ def main(): cont = True else: givenname = options.gn - if (ipavalidate.plain(givenname, notEmpty=True)): - print "First name must be letters or '" + if (ipavalidate.String(givenname, notEmpty=True)): + print "Please enter a value" return 1 cont = False if not options.sn: while (cont != True): lastname = raw_input(" Last name: [%s] " % user.getValue('sn')) - if (ipavalidate.plain(lastname, notEmpty=False)): - print "Must be letters or '" + if (ipavalidate.String(lastname, notEmpty=False)): + print "Please enter a value" else: cont = True if len(lastname) < 1: @@ -150,21 +150,21 @@ def main(): cont = True else: lastname = options.sn - if (ipavalidate.plain(lastname, notEmpty=True)): - print "Last name must be letters or '" + if (ipavalidate.String(lastname, notEmpty=True)): + print "Please enter a value" return 1 cont = False if not options.mail: while (cont != True): mail = raw_input("E-mail addr: [%s]" % user.getValue('mail')) - if (ipavalidate.email(mail, notEmpty=False)): - print "Must include a user and domain name" + if (ipavalidate.Email(mail, notEmpty=False)): + print "E-mail must include a user and domain name" else: cont = True else: mail = options.mail - if (ipavalidate.email(mail)): + if (ipavalidate.Email(mail)): print "E-mail must include a user and domain name" return 1 @@ -174,8 +174,8 @@ def main(): if not options.gecos: while (cont != True): gecos = raw_input("gecos: [%s] " % user.getValue('gecos')) - if (ipavalidate.plain(gecos, notEmpty=False)): - print "Must be letters, numbers, spaces or '" + if (ipavalidate.String(gecos, notEmpty=False)): + print "Please enter a value" else: cont = True @@ -183,8 +183,8 @@ def main(): if not options.directory: while (cont != True): directory = raw_input("home directory: [%s] " % user.getValue('homeDirectory')) - if (ipavalidate.path(gecos, notEmpty=False)): - print "Must be letters, numbers, spaces or '" + if (ipavalidate.Path(gecos, notEmpty=False)): + print "Valid path is required" else: cont = True cont = False |