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 1190893 - Allow hammer capsule content synchronization by --environment name
Summary: Allow hammer capsule content synchronization by --environment name
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Content Management
Version: 6.0.7
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: Unspecified
Assignee: Brad Buckingham
QA Contact: Sachin Ghai
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-02-09 21:44 UTC by Dave Sullivan
Modified: 2019-11-14 06:37 UTC (History)
10 users (show)

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.
Clone Of:
Environment:
Last Closed: 2016-01-21 07:41:32 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:0052 0 normal SHIPPED_LIVE Satellite 6.1.6 bug fix update 2016-01-21 12:40:53 UTC

Comment 2 Dave Sullivan 2015-08-27 15:06:37 UTC
[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 11:41:47 UTC
Created redmine issue http://projects.theforeman.org/issues/12363 from this bug

Comment 4 Bryan Kearney 2015-11-02 13:05:41 UTC
Upstream bug component is Content Management

Comment 5 Brad Buckingham 2015-11-02 21:44:30 UTC
Upstream hammer-cli-katello PR: 
  https://github.com/Katello/hammer-cli-katello/pull/330

Comment 7 Bryan Kearney 2015-12-02 17:04:29 UTC
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 08:48:44 UTC
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 09:09:15 UTC
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 07:41:32 UTC
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.