Bug 880109 - [ALL LANG][SAM CLI] No Validation for --limit with negative number for activation_key update module.
Summary: [ALL LANG][SAM CLI] No Validation for --limit with negative number for activa...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Subscription Asset Manager
Classification: Retired
Component: katello
Version: 1.2
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Adam Price
QA Contact: SAM QE List
URL:
Whiteboard:
Depends On:
Blocks: sam12-tracker
TreeView+ depends on / blocked
 
Reported: 2012-11-26 09:37 UTC by Lijun Li
Modified: 2012-12-05 22:12 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2012-12-05 22:12:08 UTC
Embargoed:


Attachments (Terms of Use)

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.


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