Bug 880973 - CCS doesn't parse arguments correctly
CCS doesn't parse arguments correctly
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: condor-wallaby-tools (Show other bugs)
Development
Unspecified Unspecified
medium Severity medium
: 2.3
: ---
Assigned To: Robert Rati
Lubos Trilety
: Regression
Depends On: 881366
Blocks: 802510
  Show dependency treegraph
 
Reported: 2012-11-28 05:08 EST by Lubos Trilety
Modified: 2013-03-19 12:38 EDT (History)
3 users (show)

See Also:
Fixed In Version: condor-wallaby-tools-5.0.5-2
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-03-19 12:38:14 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Lubos Trilety 2012-11-28 05:08:42 EST
Description of problem:
Some parameters arguments are not correctly parsed by the tool.
1. default_val or description when incorrect input is filled the condor-configure ends with fatal error
e.g.
filling number
# ccs -a -p PAR
default_val: 0
:x
fatal:  undefined method `empty?' for 0:Fixnum

leave it with blank space (removing quotas)
# ccs -a -p PAR
default_val:
:x
fatal:  undefined method `empty?' for nil:NilClass

2. must_change or needs_restart, when anything is put there different than false it's always recognized as true (not sure if this is issue, but it seems strange)
e.g.
# ccs -a -p PAR
must_change: 0
:x
Console Connection Established...
Adding the following parameter: PARZ with {}
Modifying the following parameter: PARZ with {:needsRestart=>false, :level=>0, :must_change=>true}
...

# ccs -l -p PAR
Console Connection Established...
PAR
  kind:  "string"
  default:  ""
  description:  ""
  must_change:  true
  requires_restart:  false
  visibility_level:  0
  depends:  []
  conflicts:  []
  annotation:  ""

Version-Release number of selected component (if applicable):
condor-wallaby-tools-5.0.3-2

How reproducible:
100%

Steps to Reproduce:
see above
  
Actual results:
see above

Expected results:
correctly parsed arguments

Additional info:
Comment 1 Lubos Trilety 2012-11-28 09:02:34 EST
The problem is also with array or dictionary arguments, like conflict, depends, params etc.

In previous version it says something like this:
WARNING: conflicts - Invalid value.  Resetting to pre-edit value
but all other changes are accepted and given object is created or edited.

In new version, it says something similar to:
fatal:  can't convert nil into Array
then it ends without creating or editing the object.
Comment 2 Robert Rati 2012-12-03 14:38:31 EST
Issues fixed upstream on:
BZ880973-invalid-metadata-values
Comment 5 Lubos Trilety 2012-12-07 10:54:27 EST
Tested with condor-wallaby-tools-5.0.4-1

There are still some problems with parameter arguments:

1. kind, description or default value are working with numbers. But when kind, description or default value are left as they are (blank, it doesn't matter if the quotas are there or not) the command ends with incorrect error.
# ccs -a -p PAR
Console Connection Established...
Adding the following parameter: PAR with {}
invalid argument: --kind 
Usage:  wallaby modify-param PARAMETER [...] [OPTIONS]
    -h, --help                       displays this message
        --kind VALUE                 Sets the kind property of the modified parameter
                                        (valid values are strings)
        --description VALUE          Sets the description property of the modified parameter
                                        (valid values are strings)
        --default-val VALUE          Sets the default_val property of the modified parameter
                                        (valid values are strings)
        --needs-restart VALUE        Sets the needsRestart property of the modified parameter
                                        (valid values are "yes", "no")
        --level VALUE                Sets the level property of the modified parameter
                                        (valid values are integers)
        --must-change VALUE          Sets the must_change property of the modified parameter
                                        (valid values are "yes", "no")
        --annotation VALUE           Sets the annotation property of the modified parameter
                                        (valid values are strings)
warning: ModifyParam returned non-zero
Modifying the following parameter: PAR with {:annotation=>"test"}

2. Similar problem is when level is removed and value is left empty
# ccs -a -p PAR
Console Connection Established...
Adding the following parameter: PAR with {}
invalid argument: --level 
Usage:  wallaby modify-param PARAMETER [...] [OPTIONS]
    -h, --help                       displays this message
        --kind VALUE                 Sets the kind property of the modified parameter
                                        (valid values are strings)
        --description VALUE          Sets the description property of the modified parameter
                                        (valid values are strings)
        --default-val VALUE          Sets the default_val property of the modified parameter
                                        (valid values are strings)
        --needs-restart VALUE        Sets the needsRestart property of the modified parameter
                                        (valid values are "yes", "no")
        --level VALUE                Sets the level property of the modified parameter
                                        (valid values are integers)
        --must-change VALUE          Sets the must_change property of the modified parameter
                                        (valid values are "yes", "no")
        --annotation VALUE           Sets the annotation property of the modified parameter
                                        (valid values are strings)
warning: ModifyParam returned non-zero
Modifying the following parameter: PAR with {:annotation=>"test"}

Other parameter arguments works fine (annotation was not tested because of Bug 874140). No issues found for feature, node or group arguments parsing.

>>> assigned
Comment 6 Robert Rati 2012-12-07 13:47:07 EST
The issue with empty strings is dependent upon bz881366.  It is not something that can be fixed in ccs.
Comment 7 Robert Rati 2012-12-11 12:48:42 EST
The issue with level accepting an empty value has been fixed.

Changes upstream on:
BZ880973-invalid-metadata-values
Comment 8 Lubos Trilety 2013-01-10 10:16:18 EST
Tested with condor-wallaby-tools-5.0.5-1

There is still one minor issue, when I removed quotas for annotation field and left it blank. The command ends with error, for others string fields like description, default value and kind the tool uses empty string in such case.

# ccs -e -p PAR
Console Connection Established...
Modifying the following parameter: PAR with {:kind=>"", :description=>"", :default_val=>"", :needsRestart=>false, :level=>9, :must_change=>true}
invalid argument: --annotation 
Usage:  wallaby modify-param PARAMETER [...] [OPTIONS]
    -h, --help                       displays this message
        --kind VALUE                 Sets the kind property of the modified parameter
                                        (valid values are strings)
        --description VALUE          Sets the description property of the modified parameter
                                        (valid values are strings)
        --default-val VALUE          Sets the default_val property of the modified parameter
                                        (valid values are strings)
        --needs-restart VALUE        Sets the needsRestart property of the modified parameter
                                        (valid values are "yes", "no")
        --level VALUE                Sets the level property of the modified parameter
                                        (valid values are integers)
        --must-change VALUE          Sets the must_change property of the modified parameter
                                        (valid values are "yes", "no")
        --annotation VALUE           Sets the annotation property of the modified parameter
                                        (valid values are strings)
warning: ModifyParam returned non-zero

>>> assigned
Comment 9 Robert Rati 2013-01-10 12:04:40 EST
Fixed setting annotation to an empty field.

Changes upstream on:
BZ880973-invalid-metadata-values
Comment 10 Lubos Trilety 2013-02-19 05:19:16 EST
Tested with:
condor-wallaby-tools-5.0.5-2

Tested on:
RHEL6 i386,x86_64
RHEL5 i386,x86_64

>>> verified

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