Bug 806741 - Can't update activation_key's environment.
Summary: Can't update activation_key's environment.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Subscription Asset Manager
Classification: Retired
Component: katello
Version: 1.0.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: 1.0
Assignee: Tom McKay
QA Contact: Entitlement Bugs
URL:
Whiteboard:
Depends On:
Blocks: 703617
TreeView+ depends on / blocked
 
Reported: 2012-03-26 06:41 UTC by Hui Wang
Modified: 2012-04-27 00:19 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-04-27 00:19:51 UTC
Embargoed:


Attachments (Terms of Use)

Description Hui Wang 2012-03-26 06:41:04 UTC
Description of problem:
The activation_key's environment can't be updated. System will report:  Wrong Parameters: 
[{"activation_key"=>["environment_id"]}]
 Parameters Received:
 {"id"=>"3", "activation_key"=>{"environment_id"=>3}, "action"=>"update", "controller"=>"api/activation_keys"} 

Version-Release number of selected component (if applicable):
katello-headpin-0.1.144-1.el6.noarch
katello-cli-common-0.1.107-1.el6.noarch
katello-common-0.1.306-1.el6.noarch
katello-candlepin-cert-key-pair-1.0-1.noarch
katello-certs-tools-1.0.6-1.el6.noarch
katello-headpin-all-0.1.144-1.el6.noarch
katello-configure-0.1.106-1.el6.noarch
katello-cli-headpin-0.1.16-1.el6.noarch
katello-glue-candlepin-0.1.306-1.el6.noarch
katello-selinux-0.1.9-1.el6.noarch
candlepin-0.5.26-1.el6.noarch
candlepin-tomcat6-0.5.26-1.el6.noarch
thumbslug-0.0.21-1.el6.noarch

How reproducible:
100%

Steps to Reproduce:
1. Create activation_key test_key1
# headpin -u admin -p admin activation_key create --name=test_key1 --org=ACME_Corporation --env=env1
Successfully created activation key [ test_key1 ]
2. List the activation_key test_key1's info
               
# headpin -u admin -p admin activation_key info --org=ACME_Corporation --name=test_key1
-------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                     Activation Key Info
-------------------------------------------------------------------------------------------------------------------------------------------------------------

Id:                 3
Name:               test_key1
Description:
    None
Environment Id:     2
System Template Id: None
Pools:
    [  ]

3. List the environments

[root@samserv ~]# headpin -u admin -p admin environment list --org=ACME_Corporation
-------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                      Environment List

 Id   Name        Description   Org                Prior Environment  
-------------------------------------------------------------------------------------------------------------------------------------------------------------
 1    Library     None          ACME_Corporation   None               
 2    env1        None          ACME_Corporation   Library            
 3    test_env1   None          ACME_Corporation   Library            



4. Update the environment of activation_key test_key1
# headpin -u admin -p admin activation_key update --org=ACME_Corporation --name=test_key1  --environment=test_env1Wrong/Invalid parameters sent for api/activation_keys/update.
 Wrong Parameters: 
[{"activation_key"=>["environment_id"]}]
 Parameters Received:
 {"id"=>"3", "activation_key"=>{"environment_id"=>3}, "action"=>"update", "controller"=>"api/activation_keys"} 

  
Actual results:
Can't update activation_key's environment.

Expected results:
Can update activation_key's environment.

Additional info:

# headpin -u admin -p admin activation_key update --help
Usage: headpin [options]

Options:
  -h, --help            show this help message and exit
  -g                    grep friendly output
  -v                    verbose, more structured output
  -d DELIMITER          grep friendly output column delimiter
  --name=NAME           activation key name (required)
  --org=ORG             name of organization (required)
  --environment=ENV     new environment name eg: dev
  --new_name=NEW_NAME   new template name
  --description=DESCRIPTION
                        new description
  --template=TEMPLATE   new template name eg: servers
  --add_subscription=ADD_POOLID
                        add a pool to the activation key
  --remove_subscription=REMOVE_POOLID
                        remove a pool from the activation key

Comment 1 Hui Wang 2012-03-26 06:45:37 UTC
(In reply to comment #0)

> 4. Update the environment of activation_key test_key1
> # headpin -u admin -p admin activation_key update --org=ACME_Corporation
> --name=test_key1  --environment=test_env1Wrong/Invalid parameters sent for
> api/activation_keys/update.
>  Wrong Parameters: 
> [{"activation_key"=>["environment_id"]}]
>  Parameters Received:
>  {"id"=>"3", "activation_key"=>{"environment_id"=>3}, "action"=>"update",
> "controller"=>"api/activation_keys"} 
> 
Step4 of comment0:

4. Update the environment of activation_key test_key1
# headpin -u admin -p admin activation_key update --org=ACME_Corporation
--name=test_key1  --environment=test_env1

Wrong/Invalid parameters sent for
api/activation_keys/update.
 Wrong Parameters: 
[{"activation_key"=>["environment_id"]}]
 Parameters Received:
 {"id"=>"3", "activation_key"=>{"environment_id"=>3}, "action"=>"update",
"controller"=>"api/activation_keys"}

Comment 2 Tom McKay 2012-03-26 18:24:21 UTC
commit d53e1fb714c1ce9fbe22c6ae58080a126607b362
Author: Tom McKay <thomasmckay>
Date:   Mon Mar 26 14:23:26 2012 -0400

    806741 - added missing environment_id to api/activation_keys_controller param_rules

Comment 4 Hui Wang 2012-03-31 09:57:43 UTC
Verified.
The result is PASS.

Version:
katello-cli-common-0.1.107-1.el6.noarch
katello-selinux-0.1.10-1.el6.noarch
katello-common-0.1.307-1.el6.noarch
katello-candlepin-cert-key-pair-1.0-1.noarch
katello-certs-tools-1.0.6-1.el6.noarch
katello-headpin-all-0.1.145-1.el6.noarch
katello-cli-headpin-0.1.16-1.el6.noarch
katello-headpin-0.1.145-1.el6.noarch
katello-glue-candlepin-0.1.307-1.el6.noarch
katello-configure-0.1.107-1.el6.noarch
katello-candlepin-cert-key-pair-1.0-1.noarch
candlepin-tomcat6-0.5.26-1.el6.noarch
candlepin-0.5.26-1.el6.noarch
katello-glue-candlepin-0.1.307-1.el6.noarch
thumbslug-0.0.21-1.el6.noarch


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