Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1082169 - Deleting a sync plan via the CLI fails because of incorrect expected argument
Summary: Deleting a sync plan via the CLI fails because of incorrect expected argument
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: 6.0.3
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: Unspecified
Assignee: David Davis
QA Contact: Corey Welton
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-03-28 21:42 UTC by Og Maciel
Modified: 2019-09-25 20:47 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-07-02 14:07:36 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 4955 0 None None None 2016-04-22 16:10:32 UTC

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.


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