Bug 430709 - ipa-addgroup behaviour is inconsistent
ipa-addgroup behaviour is inconsistent
Product: freeIPA
Classification: Community
Component: ipa-admintools (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Rob Crittenden
Chandrasekar Kannan
Depends On:
Blocks: freeipa10 429034
  Show dependency treegraph
Reported: 2008-01-29 10:41 EST by David O'Brien
Modified: 2015-01-04 18:30 EST (History)
1 user (show)

See Also:
Fixed In Version: freeipa-2.0.0-1.fc15
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-03-27 03:16:20 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description David O'Brien 2008-01-29 10:41:31 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):


How reproducible:

Steps to Reproduce:
Actual results:

Expected results:

Additional info:
Comment 3 Rob Crittenden 2008-01-31 11:02:49 EST
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[1]
-        if (ipavalidate.ipastsring(cn, notEmpty=True)):
+        if (ipavalidate.String(cn, notEmpty=True)):
             print "Please enter a value"
             return 1

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.
Comment 4 Yi Zhang 2008-05-28 14:20:39 EDT
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
ok" grp001
grp001 successfully added
ipaserver[05/28/08 11:18] ipa-findgroup grp001
dn: cn=grp001,cn=groups,cn=accounts,dc=ipaqa,dc=com
GID: 1100
Full Name: grp001
Description: this is 'a quote', but it should be ok

Note You need to log in before you can comment on or make changes to this bug.