Bug 1082169

Summary: Deleting a sync plan via the CLI fails because of incorrect expected argument
Product: Red Hat Satellite Reporter: Og Maciel <omaciel>
Component: HammerAssignee: David Davis <daviddavis>
Status: CLOSED CURRENTRELEASE QA Contact: Corey Welton <cwelton>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.0.3CC: bkearney, cwelton, daviddavis, mmccune
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/4955
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-02 14:07:36 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:

Description Og Maciel 2014-03-28 21:42:40 UTC
Description of problem:

The hammer sync-plan delete subcommand expects a sync-plan ID and the organization-id, but when you try to delete an existing sync-plan you get an error stating that organization_id (note the underscore) was expected


[root@qetello02 hammer_cli_katello-0.0.3]# hammer -v sync-plan info --id=184 --organization-id='ACME_Corporation'
ID:         184
Name:       GPPpNVAJDMlHDARCjWZQ
Start Date: 2014/03/28 17:13:21
Interval:   daily
Created at: 2014/03/28 21:13:21
Updated at: 2014/03/28 21:13:21

[root@qetello02 hammer_cli_katello-0.0.3]# hammer -v sync-plan delete --help
Usage:
    hammer sync-plan delete [OPTIONS]

Options:
    --id ID                       resource id
    --organization-id ORGANIZATION_ID Filter products by organization name or label
    -h, --help                    print help

[root@qetello02 hammer_cli_katello-0.0.3]# hammer -v sync-plan delete --id=184 --organization-id='ACME_Corporation'
[ERROR 2014-03-28 17:40:24 Exception] missing param 'organization_id' in parameters
Could not destroy the sync plan:
  missing param 'organization_id' in parameters
[ERROR 2014-03-28 17:40:24 Exception]

ArgumentError (missing param 'organization_id' in parameters):
    /usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.6/lib/apipie_bindings/route.rb:22:in `path'
    /usr/lib/ruby/gems/1.8/gems/logging-1.8.1/lib/logging/logger.rb:435:in `inject'
    /usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.6/lib/apipie_bindings/route.rb:20:in `each'
    /usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.6/lib/apipie_bindings/route.rb:20:in `inject'
    /usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.6/lib/apipie_bindings/route.rb:20:in `path'
    /usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.6/lib/apipie_bindings/api.rb:156:in `call'
    /usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.6/lib/apipie_bindings/resource.rb:14:in `call'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.0/lib/hammer_cli/./apipie/write_command.rb:31:in `send_request'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.0/lib/hammer_cli_foreman/commands.rb:79:in `send_request'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.0/lib/hammer_cli/./apipie/write_command.rb:10:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.0/lib/hammer_cli/./apipie/../abstract.rb:22:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.0/lib/hammer_cli/./apipie/../abstract.rb:22:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.0/lib/hammer_cli/./apipie/../abstract.rb:22:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:125:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.0/bin/hammer:100
    /usr/bin/hammer:19:in `load'
    /usr/bin/hammer:19

Version-Release number of selected component (if applicable):

* apr-util-ldap-1.3.9-3.el6_0.1.x86_64
* candlepin-0.9.7-1.el6_5.noarch
* candlepin-scl-1-5.el6_4.noarch
* candlepin-scl-quartz-2.1.5-5.el6_4.noarch
* candlepin-scl-rhino-1.7R3-1.el6_4.noarch
* candlepin-scl-runtime-1-5.el6_4.noarch
* candlepin-selinux-0.9.7-1.el6_5.noarch
* candlepin-tomcat6-0.9.7-1.el6_5.noarch
* elasticsearch-0.90.10-4.el6sat.noarch
* foreman-1.5.0.11-1.el6sat.noarch
* foreman-compute-1.5.0.11-1.el6sat.noarch
* foreman-libvirt-1.5.0.11-1.el6sat.noarch
* foreman-postgresql-1.5.0.11-1.el6sat.noarch
* foreman-proxy-1.5.4-1.el6sat.noarch
* foreman-selinux-1.5.0-0.develop.el6sat.noarch
* katello-1.5.0-19.el6sat.noarch
* katello-apache-1.0-1.noarch
* katello-ca-1.0-1.noarch
* katello-certs-tools-1.5.5-1.el6sat.noarch
* katello-installer-0.0.31-1.el6sat.noarch
* openldap-2.4.23-31.el6.x86_64
* pulp-katello-plugins-0.2-1.el6sat.noarch
* pulp-nodes-common-2.3.1-0.4.beta.el6sat.noarch
* pulp-nodes-parent-2.3.1-0.4.beta.el6sat.noarch
* pulp-puppet-plugins-2.3.1-0.4.beta.el6sat.noarch
* pulp-rpm-plugins-2.3.1-0.4.beta.el6sat.noarch
* pulp-selinux-2.3.1-0.4.beta.el6sat.noarch
* pulp-server-2.3.1-0.4.beta.el6sat.noarch
* python-ldap-2.3.10-1.el6.x86_64
* ruby193-rubygem-ldap_fluff-0.2.2-2.el6sat.noarch
* ruby193-rubygem-net-ldap-0.3.1-3.el6sat.noarch
* ruby193-rubygem-runcible-1.0.8-1.el6sat.noarch

How reproducible:


Steps to Reproduce:
1. Create a sync-plan using hammer cli
2. Try to delete this sync-plan also using the hammer cli
3.

Actual results:

Stacktrace


Expected results:


Additional info:

Comment 2 David Davis 2014-03-29 14:19:09 UTC
I'll fix the whole sync plan api as part of this.

Comment 3 Bryan Kearney 2014-03-30 20:44:06 UTC
fwiw.. I am not seeing this in the moset recent code.

Comment 4 David Davis 2014-03-31 15:04:50 UTC
https://github.com/Katello/katello/pull/3918

Comment 6 Corey Welton 2014-05-05 20:25:23 UTC
Verified in Satellite-6.0.3-RHEL-6-20140430.4


[root@mgmt5 ~]# hammer sync-plan list --organization-id "ACME_Corporation"
---|--------|----------------------|---------
ID | NAME   | START DATE           | INTERVAL
---|--------|----------------------|---------
1  | asdfas | 2014/05/05 20:23:07  | daily   
---|--------|----------------------|---------
[root@mgmt5 ~]# hammer sync-plan delete --id 1 --organization-id "ACME_Corporation"
Sync plan destroyed
[root@mgmt5 ~]# hammer sync-plan list --organization-id "ACME_Corporation"
No data.

Comment 7 Bryan Kearney 2014-07-02 14:07:36 UTC
This was delivered with 6.0.3, which is the Satellite 6 Beta.