Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 880109

Summary: [ALL LANG][SAM CLI] No Validation for --limit with negative number for activation_key update module.
Product: [Retired] Subscription Asset Manager Reporter: Lijun Li <lijli>
Component: katelloAssignee: Adam Price <adprice>
Status: CLOSED NOTABUG QA Contact: SAM QE List <sam-qe-list>
Severity: high Docs Contact:
Priority: high    
Version: 1.2CC: eng-i18n-bugs, qe-i18n-bugs, tomckay
Target Milestone: rcKeywords: i18n
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-05 22:12:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 816564    

Description Lijun Li 2012-11-26 09:37:15 UTC
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 22:12:08 UTC
--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.