Bug 985393 - CLI system commands ignore --environment option
CLI system commands ignore --environment option
Status: CLOSED CURRENTRELEASE
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Hammer (Show other bugs)
Nightly
Unspecified Unspecified
unspecified Severity medium (vote)
: Unspecified
: --
Assigned To: Dustin Tsang
sthirugn@redhat.com
http://projects.theforeman.org/issues...
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-17 07:43 EDT by Ales Dujicek
Modified: 2016-04-22 12:53 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-09-11 08:22:06 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 5697 None None None 2016-04-22 12:53 EDT

  None (edit)
Description Ales Dujicek 2013-07-17 07:43:40 EDT
Description of problem:

some CLI system commands ignore given --environment
for example
a) system list --org org --environment dev
lists all systems not only systems from given environment

b) when I register two systems with the same name but in different environments then
system info --org org --name sys --environment env
returns: Found ambiguous Systems [ sys ] in Org [ org ] ...
but it is unique system in that environment

c) commands does not care, that given system is in different environment
e.g. system info --name system --environment Library --org org

Name            : system
...
Environment     : env
...

commands with the same behaviour: facts, info, packages, unregister, update 


Version-Release number of selected component (if applicable):
katello-1.4.2-18.el6sat.noarch
katello-candlepin-cert-key-pair-1.0-1.noarch
katello-agent-1.4.3-1.git.1.24fe511.el6.noarch
katello-certs-tools-1.4.2-2.el6sat.noarch
katello-configure-1.4.3-16.el6sat.noarch
katello-glue-pulp-1.4.2-18.el6sat.noarch
katello-all-1.4.2-18.el6sat.noarch
katello-cli-common-1.4.2-8.el6sat.noarch
ruby193-rubygem-foreman-katello-engine-0.0.8-6.el6sat.noarch
signo-katello-0.0.19-1.el6sat.noarch
katello-glue-elasticsearch-1.4.2-18.el6sat.noarch
katello-configure-foreman-1.4.3-16.el6sat.noarch
katello-foreman-all-1.4.2-18.el6sat.noarch
katello-qpid-client-key-pair-1.0-1.noarch
katello-cli-1.4.2-8.el6sat.noarch
ruby193-rubygem-katello_api-0.0.3-2.el6_4.noarch
katello-common-1.4.2-18.el6sat.noarch
katello-selinux-1.4.3-3.el6sat.noarch
katello-glue-candlepin-1.4.2-18.el6sat.noarch
ruby193-rubygem-katello-foreman-engine-0.0.3-6.el6sat.noarch
katello-qpid-broker-key-pair-1.0-1.noarch


How reproducible:
always

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:
Comment 1 RHEL Product and Program Management 2013-09-17 00:22:43 EDT
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.
Comment 4 Dustin Tsang 2014-05-13 11:53:23 EDT
redmine issue created
Comment 7 Dustin Tsang 2014-06-17 13:48:52 EDT
ignore comment 5, 6.
The pull requests that fix this issue are:
https://github.com/Katello/katello/pull/4244
https://github.com/Katello/hammer-cli-katello/pull/189
Comment 9 sthirugn@redhat.com 2014-07-24 09:46:51 EDT
Verified.

Scenario a:
# hammer content-host list --organization-id=3 --lifecycle-environment='DEV'
-------------------------------------|-----------------------------------
ID                                   | NAME                              
-------------------------------------|-----------------------------------
50f8987e-1ce8-438f-ac1c-c60bd41040e7 | host1.redhat.com
-------------------------------------|-----------------------------------

# hammer content-host list --organization-id=3 --lifecycle-environment='QE'
-------------------------------------|---------------------------------
ID                                   | NAME                            
-------------------------------------|---------------------------------
0a1044fd-864d-4fed-b1c1-53324ea6926c |host2.redhat.com
-------------------------------------|---------------------------------

Scenario b: 
not a likely customer scenario to have two system names with the same name

Scenario c: (not valid anymore)
Info command does not take environment option anymore
# hammer content-host info --help
Usage:
    hammer content-host info [OPTIONS]

Version Tested:
* apr-util-ldap-1.3.9-3.el6_0.1.x86_64
* candlepin-0.9.19-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.19-1.el6_5.noarch
* candlepin-tomcat6-0.9.19-1.el6_5.noarch
* elasticsearch-0.90.10-4.el6sat.noarch
* foreman-1.6.0.29-1.el6sat.noarch
* foreman-compute-1.6.0.29-1.el6sat.noarch
* foreman-gce-1.6.0.29-1.el6sat.noarch
* foreman-libvirt-1.6.0.29-1.el6sat.noarch
* foreman-ovirt-1.6.0.29-1.el6sat.noarch
* foreman-postgresql-1.6.0.29-1.el6sat.noarch
* foreman-proxy-1.6.0.21-1.el6sat.noarch
* foreman-selinux-1.6.0-8.el6sat.noarch
* foreman-vmware-1.6.0.29-1.el6sat.noarch
* katello-1.5.0-27.el6sat.noarch
* katello-ca-1.0-1.noarch
* katello-certs-tools-1.5.6-1.el6sat.noarch
* katello-installer-0.0.56-1.el6sat.noarch
* openldap-2.4.23-32.el6_4.1.x86_64
* pulp-katello-0.3-3.el6sat.noarch
* pulp-nodes-common-2.4.0-0.23.beta.el6sat.noarch
* pulp-nodes-parent-2.4.0-0.23.beta.el6sat.noarch
* pulp-puppet-plugins-2.4.0-0.23.beta.el6sat.noarch
* pulp-puppet-tools-2.4.0-0.23.beta.el6sat.noarch
* pulp-rpm-plugins-2.4.0-0.23.beta.el6sat.noarch
* pulp-selinux-2.4.0-0.23.beta.el6sat.noarch
* pulp-server-2.4.0-0.23.beta.el6sat.noarch
* python-ldap-2.3.10-1.el6.x86_64
* ruby193-rubygem-net-ldap-0.3.1-3.el6sat.noarch
* ruby193-rubygem-runcible-1.1.0-2.el6sat.noarch
Options:
    --id ID                       ID of the content host
    --name NAME                   Name to search by
    --organization ORGANIZATION_NAME Organization name to search by
    --organization-id ORGANIZATION_ID  
    --organization-label ORGANIZATION_LABEL Organization label to search by
    -h, --help                    print help
Comment 11 Bryan Kearney 2014-09-11 08:22:06 EDT
This was delivered with Satellite 6.0 which was released on 10 September 2014.

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