[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
Created redmine issue http://projects.theforeman.org/issues/12363 from this bug
Upstream bug component is Content Management
Upstream hammer-cli-katello PR: https://github.com/Katello/hammer-cli-katello/pull/330
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.
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')]
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
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