Red Hat Bugzilla – Bug 430709
ipa-addgroup behaviour is inconsistent
Last modified: 2015-01-04 18:30:33 EST
Description of problem:
- No facility to pass the group name on the command line
- If you use -d groupDescription then you need to "Quote names with spaces".
- If you use the command in interactive mode, there is no need to quote group
names with spaces.
- If you try to pass the group name on the command line after the description
you get an ugly error:
# ipa-addgroup -d "all members of finance" finance
Traceback (most recent call last):
File "/usr/sbin/ipa-addgroup", line 118, in <module>
File "/usr/sbin/ipa-addgroup", line 71, in main
if (ipavalidate.ipastsring(cn, notEmpty=True)):
AttributeError: 'module' object has no attribute 'ipastsring'
Version-Release number of selected component (if applicable):
Steps to Reproduce:
Looks like there was a typo in the file when I did a replace to use
ipavalidate.String instead of ipavalidate.ipastring.
diff -r fc901c4cde81 -r 1fd6752e3193 ipa-admintools/ipa-addgroup
--- a/ipa-admintools/ipa-addgroup Thu Jan 31 10:52:05 2008 -0500
+++ b/ipa-admintools/ipa-addgroup Thu Jan 31 10:59:38 2008 -0500
@@ -71,7 +71,7 @@ def main():
cont = True
cn = args
- if (ipavalidate.ipastsring(cn, notEmpty=True)):
+ if (ipavalidate.String(cn, notEmpty=True)):
print "Please enter a value"
This was committed in changeset 613.
This will fix passing the group name on the command-line.
The requirement of quotes around the description is due to the shell. It
interprets anything with a space as a separate argument. Putting quotes around
something tells the shell "treat this as a single arg". There is nothing we can
do about it.
QA Verified on May 28, 2008 (Yi)
Build used: May 28, 2008 (i386)
Test as below:
ipaserver[05/28/08 11:17] ipa-addgroup -d "this is 'a quote', but it should be
grp001 successfully added
ipaserver[05/28/08 11:18] ipa-findgroup grp001
Full Name: grp001
Description: this is 'a quote', but it should be ok