Bug 806741 - Can't update activation_key's environment.
Can't update activation_key's environment.
Status: CLOSED CURRENTRELEASE
Product: Subscription Asset Manager
Classification: Red Hat
Component: katello (Show other bugs)
1.0.0
Unspecified Unspecified
medium Severity medium
: rc
: 1.0
Assigned To: Tom McKay
Entitlement Bugs
: Regression
Depends On:
Blocks: 703617
  Show dependency treegraph
 
Reported: 2012-03-26 02:41 EDT by Hui Wang
Modified: 2012-04-26 20:19 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-04-26 20:19:51 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Hui Wang 2012-03-26 02:41:04 EDT
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 02:45:37 EDT
(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 14:24:21 EDT
commit d53e1fb714c1ce9fbe22c6ae58080a126607b362
Author: Tom McKay <thomasmckay@redhat.com>
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 05:57:43 EDT
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.