Bug 880973 - CCS doesn't parse arguments correctly
Summary: CCS doesn't parse arguments correctly
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: condor-wallaby-tools
Version: Development
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: 2.3
: ---
Assignee: Robert Rati
QA Contact: Lubos Trilety
URL:
Whiteboard:
Depends On: 881366
Blocks: 802510
TreeView+ depends on / blocked
 
Reported: 2012-11-28 10:08 UTC by Lubos Trilety
Modified: 2013-03-19 16:38 UTC (History)
3 users (show)

Fixed In Version: condor-wallaby-tools-5.0.5-2
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-03-19 16:38:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Lubos Trilety 2012-11-28 10:08:42 UTC
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 14:02:34 UTC
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 19:38:31 UTC
Issues fixed upstream on:
BZ880973-invalid-metadata-values

Comment 5 Lubos Trilety 2012-12-07 15:54:27 UTC
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 18:47:07 UTC
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 17:48:42 UTC
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 15:16:18 UTC
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 17:04:40 UTC
Fixed setting annotation to an empty field.

Changes upstream on:
BZ880973-invalid-metadata-values

Comment 10 Lubos Trilety 2013-02-19 10:19:16 UTC
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.