Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1190893 - Allow hammer capsule content synchronization by --environment name
Allow hammer capsule content synchronization by --environment name
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Content Management (Show other bugs)
6.0.7
Unspecified Unspecified
medium Severity medium (vote)
: 6.1.6
: Unused
Assigned To: Brad Buckingham
Sachin Ghai
http://projects.theforeman.org/issues...
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-02-09 16:44 EST by Dave Sullivan
Modified: 2017-02-23 15:33 EST (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Support for synchronizing a capsule for a specific environment was added to the hammer command line.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-01-21 02:41:32 EST
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
Red Hat Product Errata RHBA-2016:0052 normal SHIPPED_LIVE Satellite 6.1.6 bug fix update 2016-01-21 07:40:53 EST

  None (edit)
Comment 2 Dave Sullivan 2015-08-27 11:06:37 EDT
[root@cragsat61 ~]# hammer -u admin lifecycle-environment list --help
Usage:
    hammer lifecycle-environment list [OPTIONS]

Options:
 --library LIBRARY                       set true if you want to see only library environments
 --name NAME                             filter only environments containing this name
 --organization ORGANIZATION_NAME        Organization name to search by
 --organization-id ORGANIZATION_ID       organization ID
 --organization-label ORGANIZATION_LABEL Organization label to search by
 -h, --help      

[root@cragsat61 ~]# hammer -u admin lifecycle-environment list --organization CragSat61
[Foreman] Password for admin: 
---|-------------|------------
ID | NAME        | PRIOR      
---|-------------|------------
8  | Production  | Development
2  | Library     |            
7  | Development | Library    
---|-------------|------------ 

[root@cragsat61 ~]# hammer -u admin organization list
[Foreman] Password for admin: 
---|-----------|-----------|------------
ID | NAME      | LABEL     | DESCRIPTION
---|-----------|-----------|------------
3  | CragSat61 | cragsat61 |            
---|-----------|-----------|------------

[root@cragsat61 ~]# hammer -u admin capsule content lifecycle-environments --help
Usage:
    hammer capsule content lifecycle-environments [OPTIONS]

Options:
 --id ID                                 Id of the capsule
 --name NAME                             Name to search by
 --organization ORGANIZATION_NAME        Organization name to search by
 --organization-id ORGANIZATION_ID       organization ID
 --organization-label ORGANIZATION_LABEL Organization label to search by
 -h, --help                              print help


From above we should be able to list/synchronize by --name

[root@cragsat61 ~]# hammer -u admin capsule list
[Foreman] Password for admin: 
---|------------------------------|------------------------------------------
ID | NAME                         | URL                                      
---|------------------------------|------------------------------------------
1  | cragsat61.usersys.redhat.com | https://cragsat61.usersys.redhat.com:9090
---|------------------------------|------------------------------------------


[root@cragsat61 ~]# hammer -u admin capsule content lifecycle-environments --name cragsat61.usersys.redhat.com --organization-id 3
Error: undefined method `[]' for nil:NilClass

you can see this doesn't work, slightly different bug I guess from synchronize

now using capsule id it works or passes hammer cli

[root@cragsat61 ~]# hammer -u admin capsule content lifecycle-environments --id 1 --organization-id 3
[Foreman] Password for admin: 
Couldn't find SmartProxy with id=1 [WHERE "features"."name" IN ('Pulp Node')]

So this bug is after synchronize by --environment as --environment-id works as noted in description

[root@cragsat61 ~]# hammer -u admin capsule content synchronize --help
Usage:
    hammer capsule content synchronize [OPTIONS]

Options:
 --async                         Do not wait for the task
 --environment ENVIRONMENT_NAME  Environment name
 --environment-id ENVIRONMENT_ID  
 --id ID                         Id of the capsule
 --name NAME                     Name to search by
 -h, --help                      print help
Comment 3 Brad Buckingham 2015-11-02 06:41:47 EST
Created redmine issue http://projects.theforeman.org/issues/12363 from this bug
Comment 4 Bryan Kearney 2015-11-02 08:05:41 EST
Upstream bug component is Content Management
Comment 5 Brad Buckingham 2015-11-02 16:44:30 EST
Upstream hammer-cli-katello PR: 
  https://github.com/Katello/hammer-cli-katello/pull/330
Comment 7 Bryan Kearney 2015-12-02 12:04:29 EST
Moving to POST since upstream bug http://projects.theforeman.org/issues/12363 has been closed
-------------
Brad Buckingham
Applied in changeset commit:hammer-cli-katello|64a8f05b29b846b5df9f98830b37b5e0c4b8c5c8.
Comment 9 Sachin Ghai 2016-01-08 03:48:44 EST
Verified with Satellite 6.1.6 compose4(20160107)

the issue reported in bug description is fixed. I can sync capsule content by --environment name

[root@cloud-qe-20 ~]#  hammer -u admin capsule content synchronize --environment Dev --id 2  --organization-id 1
[Foreman] Password for admin: 
[............................................................................................................................................] [100%]


However,this bz include 3 different issue. One is fixed as above.
other two issues are:

Issue#1:
=====

content-synchronization by capsule name throw following error:

[root@cloud-qe-20 yum.repos.d]# hammer -u admin capsule content synchronize --environment Dev --name cloud-qe-17.redhat.com  --organization-id 1
[Foreman] Password for admin: 
Could not synchronize capsule content:
  Error: undefined method `[]' for nil:NilClass


Issue#2:
======
getting following error, while listing the lifecycle environment attached to capsule

[root@cloud-qe-6 ~]# hammer -u admin capsule content lifecycle-environments --name cloud-qe-6.idmqe.lab.eng.bos.redhat.com --organization-id 1
[Foreman] Password for admin: 
Couldn't find SmartProxy with id=1 [WHERE "features"."name" IN ('Pulp Node')]
Comment 10 Sachin Ghai 2016-01-08 04:09:15 EST
Filed separate issues for issue #1 and #2.

issue #1:  https://bugzilla.redhat.com/show_bug.cgi?id=1296827
issue #2:  https://bugzilla.redhat.com/show_bug.cgi?id=1296843
Comment 13 errata-xmlrpc 2016-01-21 02:41:32 EST
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/RHBA-2016:0052

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