Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1091494 - hammer cli does not follow env paths while promotion
hammer cli does not follow env paths while promotion
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Hammer (Show other bugs)
6.0.3
Unspecified Unspecified
unspecified Severity medium (vote)
: Unspecified
: Unused
Assigned To: Mike McCune
Tazim Kolhar
http://projects.theforeman.org/issues...
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-25 13:58 EDT by Kedar Bidarkar
Modified: 2017-02-23 16:17 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Release Note
Doc Text:
Users of the Red Hat Satellite 6 Beta should not make use of this loophole. It can result in unpredictable results. The GA version will not allow users to take this action.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-08-12 01:08:20 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 7243 None None None 2016-04-22 12:55 EDT
Red Hat Product Errata RHSA-2015:1592 normal SHIPPED_LIVE Important: Red Hat Satellite 6.1.1 on RHEL 6 2015-08-12 05:04:35 EDT

  None (edit)
Description Kedar Bidarkar 2014-04-25 13:58:10 EDT
Description of problem:

WE can promote content from any env to any env via hammer CLI irrespective of the env paths.

Library --> Dev --> Test
Library --> Dev2 --> Test2

Using CLI we can promote from
a) Library to test 
b) and even Dev to Test2

Web-UI only allows in a serialized fashion, one after the other, following the env paths.

Version-Release number of selected component (if applicable):
Satellite-6.0.3-RHEL-6-20140404.0/

How reproducible:


Steps to Reproduce:
1. have atleast 2 env paths ( Library, Dev, Test and Library, Dev1, Test1) apart from Library
2. Trying promoting from Library directly to Test
3. Trying promoting from Dev to Test2

Actual results:

Currently we can promote from any env to any env, as explained above,

Expected results:

CLI must follow env paths while promotion.

Additional info:
Comment 1 Kedar Bidarkar 2014-04-25 13:59:42 EDT
[root@xxx ~]# hammer lifecycle-environment list --organization-id "ACME_Corporation"
----|---------|----------------
ID  | NAME    | PRIOR          
----|---------|----------------
232 | omkar   | id201namekedar 
1   | Library |                
201 | kedar   | id1nameLibrary 
234 | omkar2  | id233namekedar2
233 | kedar2  | id1nameLibrary 
----|---------|----------------
[root@xxxx ~]# hammer content-view version promote --environment-id 234 --id 231
[....................................................................................................................................................................................] [100%]
Task f5349e68-61f0-4230-95ef-9da3d107c858: success
{}
[root@xxxx ~]# hammer content-view version info --id 201
ID:                 201
Name:               cv-omkar 3
Version:            3
Content View ID:    228
Content View Name:  cv-omkar
Content View Label: cv-omkar
Environments:       
 1) ID:    201
    Name:  kedar
    Label: kedar
Repositories:       

Puppet Modules:

[root@xxxx ~]# hammer content-view version promote --environment-id 234 --id 201
[....................................................................................................................................................................................] [100%]
Task 3cf92a37-6097-49fc-a2e6-96c0c4a9eb7e: success
{}
[root@xxxx ~]# hammer content-view version info --id 201
ID:                 201
Name:               cv-omkar 3
Version:            3
Content View ID:    228
Content View Name:  cv-omkar
Content View Label: cv-omkar
Environments:       
 1) ID:    201
    Name:  kedar
    Label: kedar
 2) ID:    234
    Name:  omkar2
    Label: o
Repositories:       

Puppet Modules:
Comment 3 Dustin Tsang 2014-08-01 09:36:09 EDT
Currently the api allows the user to promote to a lifecycle environment out of sequence. This could be a possible feature rather than a bug. Possibly the UI should allow this too.
Comment 4 David Davis 2014-08-22 09:51:43 EDT
I'd say we probably want to have a setting (default to ON probably) about whether to enforce environment paths. Another option would be a permission.
Comment 5 Dustin Tsang 2014-08-23 02:23:53 EDT
Created redmine issue http://projects.theforeman.org/issues/7243 from this bug
Comment 6 Bryan Kearney 2014-10-01 02:02:07 EDT
Moving to POST since upstream bug http://projects.theforeman.org/issues/7243 has been closed
-------------
dustin tsang
Applied in changeset commit:katello|0aa23f25fc39bf09aa69256bbe285708a2897879.
Comment 7 Tazim Kolhar 2014-10-10 08:18:30 EDT
VERIFIED:


*** This bug is verified in upstream.  This fix should eventually land in future downstream builds ***

# rpm -qa | grep foreman
foreman-gce-1.7.0-0.develop.201410081938git1cf31c6.el7.noarch
ruby193-rubygem-foreman_discovery-1.4.0-0.1.rc4.el7.noarch
hp-bl420cgen8-01.rhts.eng.bos.redhat.com-foreman-proxy-1.0-1.noarch
foreman-compute-1.7.0-0.develop.201410081938git1cf31c6.el7.noarch
ruby193-rubygem-foreman_hooks-0.3.7-2.el7.noarch
rubygem-hammer_cli_foreman_tasks-0.0.3-2.201409091410git163c264.git.0.988ca80.el7.noarch
foreman-release-1.7.0-0.develop.201410071158git54141ab.el7.noarch
foreman-proxy-1.7.0-0.develop.201410081229git52f0bac.el7.noarch
hp-bl420cgen8-01.rhts.eng.bos.redhat.com-foreman-client-1.0-1.noarch
foreman-ovirt-1.7.0-0.develop.201410081938git1cf31c6.el7.noarch
ruby193-rubygem-foreman-tasks-0.6.9-1.el7.noarch
foreman-selinux-1.7.0-0.develop.201409301113git2f345de.el7.noarch
foreman-postgresql-1.7.0-0.develop.201410081938git1cf31c6.el7.noarch
foreman-vmware-1.7.0-0.develop.201410081938git1cf31c6.el7.noarch
ruby193-rubygem-foreman_bootdisk-4.0.0-1.el7.noarch
foreman-1.7.0-0.develop.201410081938git1cf31c6.el7.noarch
foreman-libvirt-1.7.0-0.develop.201410081938git1cf31c6.el7.noarch
rubygem-hammer_cli_foreman-0.1.3-1.201409191432gitc38f9c8.el7.noarch

# hammer content-view version promote --content-view con_view  --from-lifecycle-environment Library --to-lifecycle-environment TEST --id 3 --organization testorg
[Foreman] username: admin
[Foreman] password for admin: 
Could not promote the content view:
  Cannot promote environment out of sequence. Use force to bypass restriction.
Comment 9 Bryan Kearney 2015-08-11 09:31:21 EDT
This bug is slated to be released with Satellite 6.1.
Comment 10 errata-xmlrpc 2015-08-12 01:08:20 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2015:1592

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