Bug 1223086 - Some parameter in Sat 6.1 CLI were renamed
Summary: Some parameter in Sat 6.1 CLI were renamed
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: 6.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: Unspecified
Assignee: Martin Bacovsky
QA Contact: Tazim Kolhar
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-05-19 19:20 UTC by Martin Bacovsky
Modified: 2017-02-23 20:00 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-08-12 14:02:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Sat 6.0 options (162.20 KB, text/plain)
2015-05-19 19:20 UTC, Martin Bacovsky
no flags Details
Sat 6.1 options (117.87 KB, text/plain)
2015-05-19 19:21 UTC, Martin Bacovsky
no flags Details
Options diff (96.45 KB, patch)
2015-05-19 19:22 UTC, Martin Bacovsky
no flags Details | Diff
Proposed patch (3.51 KB, patch)
2015-05-19 19:25 UTC, Martin Bacovsky
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 10628 0 None None None 2016-04-22 16:40:44 UTC

Description Martin Bacovsky 2015-05-19 19:20:31 UTC
Created attachment 1027392 [details]
Sat 6.0 options

Description of problem:
In Satellite 6.1 some CLI parameters were renamed which can break customer scripts.

How reproducible:
Always 

Steps to Reproduce:
I patched hammer-cli-console and produced diff of hammer options between Satellite 6.0 and 6.1.

Steps to get the list:
- Clean Sat6.x install
- gem install hammer-cli-console (with https://github.com/komidore64/hammer-cli-console/pull/4 merged)
- cat > /etc/hammer/cli.commands.d/console.yml <<EOF
:console:
  :enable_module: true
EOF
- hammer -u admin -p <password> command-tree --with-options > hammer_sat6.0.txt

The resulting files are attached.

The main differences are caused partly by aliased options e.g. puppetclass -> puppet-class, ptable->partition-table, etc and partly by various changes in content-view options.


Actual results:
e.g. hammer os add-ptable --id 1 --ptable-id 1
Fails with unrecognised option

Expected results:
e.g. hammer os add-ptable --id 1 --ptable-id 1
Os updated

Additional info:
Patch for aliased options is ready. For Katello stuff the changes need review as some are intentional.

Comment 1 Martin Bacovsky 2015-05-19 19:21:30 UTC
Created attachment 1027393 [details]
Sat 6.1 options

Comment 2 Martin Bacovsky 2015-05-19 19:22:16 UTC
Created attachment 1027394 [details]
Options diff

Comment 3 Martin Bacovsky 2015-05-19 19:25:22 UTC
Created attachment 1027395 [details]
Proposed patch

The proposed patch needs some more testing

Comment 5 Martin Bacovsky 2015-05-26 16:11:56 UTC
The fix requires https://github.com/theforeman/hammer-cli/pull/169 to work!

Merge request [1] covers issues in hammer-cli-foreman. Issues related to Katello commands needs to be addressed in separate MR.

The changes covered in the MR:

d = deleted, r = renamed

Options left removed:

d hammer > host > create | --sp-subnet-id [never worked]
d hammer > host > update | --sp-subnet-id [never worked]

Options added with deprecation warning:

d hammer > host > puppet-classes | --environment 
d hammer > host > puppet-classes | --environment-id
d hammer > host > puppet-classes | --hostgroup
d hammer > host > puppet-classes | --hostgroup-id

r hammer > host > puppet-classes | --id => --host-id
r hammer > host > puppet-classes | --name => --host

d hammer > hostgroup > puppet-classes | --environment
d hammer > hostgroup > puppet-classes | --environment-id
d hammer > hostgroup > puppet-classes | --host
d hammer > hostgroup > puppet-classes | --host-id

r hammer > sc-param > list | --puppetclass => --puppet-class
r hammer > sc-param > list | --puppetclass-id => --puppet-class-id
r hammer > puppet-class > sc-params | --puppetclass => --puppet-class
r hammer > puppet-class > sc-params | --puppetclass-id => --puppet-class-id
r hammer > os > update | --ptable-ids => --partition-table-ids
r hammer > os > remove-ptable | --ptable => --partition-table
r hammer > os > remove-ptable | --ptable-id => --partition-table-id
r hammer > os > create | --ptable-ids => --partition-table-ids
r hammer > os > add-ptable | --ptable => --partition-table
r hammer > os > add-ptable | --ptable-id => --partition-table-id
r hammer > hostgroup > update | --puppetclass-ids => --puppet-class-ids
r hammer > hostgroup > update | --ptable-id => --partition-table-id
r hammer > hostgroup > update | --ptable => --partition-table
r hammer > hostgroup > create | --puppetclass-ids => --puppet-class-ids
r hammer > hostgroup > create | --ptable-id => --partition-table-id
r hammer > hostgroup > create | --ptable => --partition-table
r hammer > hostgroup > sc-params | --puppetclass => --puppet-class
r hammer > hostgroup > sc-params | --puppetclass-id => --puppet-class-id
r hammer > host > update | --puppetclass-ids => --puppet-class-ids
r hammer > host > update | --ptable-id => --partition-table-id
r hammer > host > update | --ptable => --partition-table
r hammer > host > create | --puppetclass-ids => --puppet-class-ids
r hammer > host > create | --ptable-id => --partition-table-id
r hammer > host > create | --ptable => --partition-table
r hammer > host > sc-params | --puppetclass => --puppet-class
r hammer > host > sc-params | --puppetclass-id => --puppet-class-id
r hammer > environment > sc-params | --puppetclass => --puppet-class
r hammer > environment > sc-params | --puppetclass-id => --puppet-class-id


DOCS: Should the deprecated options be part of upgrade documentation? 


[1] https://gitlab.sat.lab.tlv.redhat.com/satellite6/hammer-cli-foreman/merge_requests/5

Comment 6 Bryan Kearney 2015-05-26 16:58:16 UTC
commit d74d6ff3fcc0f543be9542e6c02c57032dc5db44
Author: Martin Bačovský <martin.bacovsky>
Date:   Wed May 20 18:03:56 2015 +0200

    Fixes #10564 - Added support for deprecated options
    
    (cherry picked from commit 407cafe6376175602509e44f9c4c3f75004c50dd)

[1] https://gitlab.sat.lab.tlv.redhat.com/satellite6/hammer-cli-foreman/merge_requests/5

Comment 7 Adam Price 2015-05-27 15:52:06 UTC
Created redmine issue http://projects.theforeman.org/issues/10628 from this bug

Comment 9 Tazim Kolhar 2015-05-28 09:31:39 UTC
VERIFIED:

# rpm -qa | grep foreman
foreman-1.7.2.25-1.el7sat.noarch
ruby193-rubygem-foreman-tasks-0.6.12.5-1.el7sat.noarch
ruby193-rubygem-foreman_gutterball-0.0.1.9-1.el7sat.noarch
hp-ml150g6-01.rhts.eng.bos.redhat.com-foreman-proxy-client-1.0-1.noarch
ruby193-rubygem-foreman_docker-1.2.0.14-1.el7sat.noarch
foreman-debug-1.7.2.25-1.el7sat.noarch
foreman-ovirt-1.7.2.25-1.el7sat.noarch
ruby193-rubygem-foreman-redhat_access-0.1.0-1.el7sat.noarch
rubygem-hammer_cli_foreman_bootdisk-0.1.2.7-1.el7sat.noarch
rubygem-hammer_cli_foreman_docker-0.0.3.6-1.el7sat.noarch
foreman-selinux-1.7.2.13-1.el7sat.noarch
ruby193-rubygem-foreman_bootdisk-4.0.2.13-1.el7sat.noarch
foreman-vmware-1.7.2.25-1.el7sat.noarch
ruby193-rubygem-foreman_hooks-0.3.7-2.el7sat.noarch
rubygem-hammer_cli_foreman_discovery-0.0.1.10-1.el7sat.noarch
foreman-proxy-1.7.2.4-1.el7sat.noarch
hp-ml150g6-01.rhts.eng.bos.redhat.com-foreman-client-1.0-1.noarch
hp-ml150g6-01.rhts.eng.bos.redhat.com-foreman-proxy-1.0-2.noarch
foreman-gce-1.7.2.25-1.el7sat.noarch
rubygem-hammer_cli_foreman-0.1.4.12-1.el7sat.noarch
foreman-compute-1.7.2.25-1.el7sat.noarch
ruby193-rubygem-foreman_discovery-2.0.0.14-1.el7sat.noarch
rubygem-hammer_cli_foreman_tasks-0.0.3.4-1.el7sat.noarch
foreman-libvirt-1.7.2.25-1.el7sat.noarch
foreman-postgresql-1.7.2.25-1.el7sat.noarch

steps:
# hammer os add-ptable --id 1 --ptable-id 1
[Foreman] Username: admin
[Foreman] Password for admin: 
Partition table has been associated

Comment 10 Martin Bacovsky 2015-05-28 11:18:42 UTC
I found there is a typo in host update (underscore in --puppetclass_ids):
--puppet-class-ids, --puppetclass_ids PUPPET_CLASS_IDS Comma separated list of values.

And Katello part is not fixed at all. Two more PRs will follow.

Moving back to ASSIGNED.

Comment 11 Martin Bacovsky 2015-05-28 11:37:46 UTC
First part of Katello related issues that were bugs was fixed upstream with this PR:
https://github.com/Katello/hammer-cli-katello/pull/297

U = fixed upstream

Ud hammer > content-view > version > delete | --content-view
Ud hammer > content-view > version > delete | --content-view-id
Ud hammer > content-view > version > info | --content-view
Ud hammer > content-view > version > info | --content-view-id

Ud hammer > puppet-module > info | --organization
Ud hammer > puppet-module > info | --organization-id
Ud hammer > puppet-module > info | --organization-label

Ud hammer > puppet-module > list | --content-view
Ud hammer > puppet-module > list | --content-view-id
Ud hammer > puppet-module > list | --organization
Ud hammer > puppet-module > list | --organization-id
Ud hammer > puppet-module > list | --organization-label

Ud hammer > content-view > version > delete | --organization
Ud hammer > content-view > version > delete | --organization-id
Ud hammer > content-view > version > delete | --organization-label

Ud hammer > content-view > version > info | --organization
Ud hammer > content-view > version > info | --organization-id
Ud hammer > content-view > version > info | --organization-label

Ud hammer > content-view > version > list | --organization
Ud hammer > content-view > version > list | --organization-id
Ud hammer > content-view > version > list | --organization-label

Comment 12 Martin Bacovsky 2015-05-28 11:51:37 UTC
Rest of the Katello related issues were fixed with MR https://gitlab.sat.lab.tlv.redhat.com/satellite6/hammer-cli-katello/merge_requests/5

Kind of change: d = deleted, r = renamed

Options agged with deprecation warning

r hammer > content-view > add-version | --content-view => --name
r hammer > content-view > add-version | --content-view-id => --id
r hammer > content-view > remove-version | --content-view => --name
r hammer > content-view > remove-version | --content-view-id => --id

r hammer > content-view > version > delete | --name => --version
r hammer > content-view > version > info | --name => --version

r hammer > content-view > version > promote | --name => --version
r hammer > content-view > version > promote | --lifecycle-environment => --to-lifecycle-environment
r hammer > content-view > version > promote | --lifecycle-environment-id => --to-lifecycle-environment-id

r hammer > content-view > puppet-module > add | --uuid => --id

r hammer > product > set-sync-plan | --sync_plan_id => --sync-plan-id

d hammer > product > remove-sync-plan | --sync-plan
d hammer > product > remove-sync-plan | --sync-plan-id

Comment 13 Martin Bacovsky 2015-05-28 11:57:10 UTC
Fix for the typo in 'host update' (see comment#10 for details) is in https://gitlab.sat.lab.tlv.redhat.com/satellite6/hammer-cli-foreman/merge_requests/6

Comment 14 Martin Bacovsky 2015-05-28 11:58:30 UTC
Now all the necessary PRs have been submited and linked in this BZ.

Comment 15 Martin Bacovsky 2015-05-28 13:37:29 UTC
Upstream PR on hammer-cli-katello was merged. Moving to POST.

To fix this downstream:

Cherry-pick: https://github.com/Katello/hammer-cli-katello/pull/297
Review and Merge: https://gitlab.sat.lab.tlv.redhat.com/satellite6/hammer-cli-katello/merge_requests/5
Review and Merge: https://gitlab.sat.lab.tlv.redhat.com/satellite6/hammer-cli-foreman/merge_requests/6

Comment 17 Tazim Kolhar 2015-06-04 10:44:45 UTC
VERIFIED:

# rpm -qa  | grep foreman
foreman-compute-1.7.2.26-1.el6_6sat.noarch
ruby193-rubygem-foreman-redhat_access-0.1.0-1.el6_6sat.noarch
rubygem-hammer_cli_foreman-0.1.4.13-1.el6_6sat.noarch
foreman-vmware-1.7.2.26-1.el6_6sat.noarch
ruby193-rubygem-foreman_bootdisk-4.0.2.13-1.el6_6sat.noarch
ruby193-rubygem-foreman_gutterball-0.0.1.9-1.el6_6sat.noarch
foreman-postgresql-1.7.2.26-1.el6_6sat.noarch
foreman-libvirt-1.7.2.26-1.el6_6sat.noarch
ruby193-rubygem-foreman-tasks-0.6.12.7-1.el6_6sat.noarch
rubygem-hammer_cli_foreman_bootdisk-0.1.2.7-1.el6_6sat.noarch
rubygem-hammer_cli_foreman_docker-0.0.3.6-1.el6_6sat.noarch
foreman-selinux-1.7.2.13-1.el6_6sat.noarch
foreman-debug-1.7.2.26-1.el6_6sat.noarch
foreman-ovirt-1.7.2.26-1.el6_6sat.noarch
foreman-gce-1.7.2.26-1.el6_6sat.noarch
ruby193-rubygem-foreman_discovery-2.0.0.15-1.el6_6sat.noarch
foreman-proxy-1.7.2.5-1.el6_6sat.noarch
rubygem-hammer_cli_foreman_tasks-0.0.3.4-1.el6_6sat.noarch
intel-s3e3432-01.rhts.eng.bos.redhat.com-foreman-proxy-client-1.0-1.noarch
ruby193-rubygem-foreman_docker-1.2.0.14-1.el6_6sat.noarch
intel-s3e3432-01.rhts.eng.bos.redhat.com-foreman-client-1.0-1.noarch
intel-s3e3432-01.rhts.eng.bos.redhat.com-foreman-proxy-1.0-1.noarch
foreman-1.7.2.26-1.el6_6sat.noarch
ruby193-rubygem-foreman_hooks-0.3.7-2.el6_6sat.noarch
rubygem-hammer_cli_foreman_discovery-0.0.1.10-1.el6_6sat.noarch

steps:
# hammer content-view add-version --help
--id,
--name

# hammer content-view remove-version --help
--id,
--name

# hammer content-view version info --help
--version, --name VERSION   

# hammer content-view version delete --help
--version, --name VERSION 

# hammer > content-view > version > promote 
,--to-lifecycle-environment
 --to-lifecycle-environment-id
 --version

# hammer content-view puppet-module add --help
--id

# hammer product set-sync-plan --help
--sync-plan-id

Comment 18 Bryan Kearney 2015-08-11 13:28:38 UTC
This bug is slated to be released with Satellite 6.1.

Comment 19 Bryan Kearney 2015-08-12 14:02:46 UTC
This bug was fixed in version 6.1.1 of Satellite which was released on 12 August, 2015.


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