Bug 430709 - ipa-addgroup behaviour is inconsistent
Summary: ipa-addgroup behaviour is inconsistent
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: freeIPA
Classification: Retired
Component: ipa-admintools
Version: 1.0
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Rob Crittenden
QA Contact: Chandrasekar Kannan
URL:
Whiteboard:
Depends On:
Blocks: freeipa10 429034
TreeView+ depends on / blocked
 
Reported: 2008-01-29 15:41 UTC by David O'Brien
Modified: 2015-01-04 23:30 UTC (History)
1 user (show)

Fixed In Version: freeipa-2.0.0-1.fc15
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-03-27 07:16:20 UTC
Embargoed:


Attachments (Terms of Use)

Description David O'Brien 2008-01-29 15:41:31 UTC
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>
    sys.exit(main())
  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):

http://apoc.dsdev.sjc.redhat.com/tet/results/FC7/i386/2008-01-28_03_01-build/dist

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 3 Rob Crittenden 2008-01-31 16:02:49 UTC
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
     else:
         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 18:20:39 UTC
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.