Bug 880109 - [ALL LANG][SAM CLI] No Validation for --limit with negative number for activation_key update module.
[ALL LANG][SAM CLI] No Validation for --limit with negative number for activa...
Status: CLOSED NOTABUG
Product: Subscription Asset Manager
Classification: Red Hat
Component: katello (Show other bugs)
1.2
x86_64 Linux
high Severity high
: rc
: ---
Assigned To: Adam Price
SAM QE List
: i18n
Depends On:
Blocks: sam12-tracker
  Show dependency treegraph
 
Reported: 2012-11-26 04:37 EST by Lijun Li
Modified: 2012-12-05 17:12 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-12-05 17:12:08 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Lijun Li 2012-11-26 04:37:15 EST
Description of problem:
No Validation for --limit with negative number for activation_key update module,
Should have the Validation failed message if update the --limit with negative number.

Version-Release number of selected component (if applicable):
Subscription Asset Manager Version: 1.2.5-1h.el6_3

How reproducible:
100%

Steps to Reproduce:
[root@i18nsamtest ~]# headpin -u admin -p admin activation_key update --name=test --org=test --new_name=test --environment=test --description=test --limit=-1
アクティベーションキー [ test ] が正常に更新されました
[root@i18nsamtest ~]# headpin -u admin -p admin activation_key update --name=test --org=test --new_name=test --environment=test --description=test --limit=test
Validation failed: Usage limit must be higher than current usage (0) or unlimited
[root@i18nsamtest ~]# headpin -u admin -p admin activation_key update --name=test --org=test --new_name=test --environment=test --description=test --limit=0
Validation failed: Usage limit must be higher than current usage (0) or unlimited
[root@i18nsamtest ~]# LANG=en_US.UTF-8 headpin -u admin -p admin activation_key update --name=test --org=test --new_name=test --environment=test --description=test --limit=2
Successfully updated activation key [ test ]
[root@i18nsamtest ~]# LANG=en_US.UTF-8 headpin -u admin -p admin activation_key update --name=test --org=test --new_name=test --environment=test --description=test --limit=-1
Successfully updated activation key [ test ]
^^^^^^^^^^^^^^No Validation for --limit with negative number
  
Actual results:
No Validation for --limit with negative number.

Expected results:
Should have the Validation failed message if update the --limit with negative number.

Additional info:
Comment 1 Adam Price 2012-12-05 17:12:08 EST
--limit=-1 denotes "unlimited" as stated in the help output.

[ root@pepsi ~ ]
==> headpin -u admin -p admin activation_key update --help
Usage:  headpin <options> activation_key update <options>

Options:
  -h, --help            show this help message and exit
  --name=NAME           activation key name (required)
  --org=ORG             name of organization e.g.: ACME_Corporation (required)
  --environment=ENV     new environment name e.g.: dev
  --new_name=NEW_NAME   new template name
  --description=DESCRIPTION
                        new description
  --template=TEMPLATE   new template name eg: servers
  --limit=USAGE_LIMIT   usage limit (set -1 for no limit)
  --add_subscription=ADD_POOLID
                        add a pool to the activation key
  --remove_subscription=REMOVE_POOLID
                        remove a pool from the activation key
  -g                    grep friendly output
  -v                    verbose, more structured output
  -d DELIMITER          column delimiter in grep friendly output, works only
                        with option -g
  --noheading           Suppress any heading output. Useful if grepping the
                        output.

numbers less than -1 do not pass validation.

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