Satellite hammer cli can't synchronize capsule content by environment name

Solution Unverified - Updated

Environment

Red Hat Satellite or Proxy
6.0

Issue

It appears that you can't synchronize capsule content by environment name.

However you can by environment id.

Referencing by environment name does not work

[root@acme123 cript]#
[root@acme123 script]# hammer -u admin -p changeme capsule content synchronize --environment 'development' --name 'capsule1.acme.com'
Could not synchronize capsule content:
  Error: environment not found
[root@acme123 script]#

[root@acme123 script]# hammer -u admin -p changeme lifecycle-environment list --organization ACME
-

ID | NAME        | PRIOR
-|-|-
2  | Library     |
5  | production  | stage
8  | STG         | Library
4  | stage       | development
7  | Dev         | Library
3  | development | Library

9  | PROD        | Library
-|-|-
[root@acme123 script]#

Referencing by environment id works

[root@acme123 script]# hammer -u admin -p changeme capsule content synchronize --environment-id 3 --id 2

Resolution

Reference By ID:


[root@acme123 script]# hammer -u admin -p changeme lifecycle-environment list --organization ACME
-

ID | NAME        | PRIOR
-|-|-
2  | Library     |
5  | production  | stage
8  | STG         | Library
4  | stage       | development
7  | Dev         | Library
3  | development | Library

9  | PROD        | Library
-|-|-
[root@acme123 script]# hammer -u admin -p changeme capsule content synchronize --environment-id 3 --id 2

For more KB articles/solutions related to Red Hat Satellite 6.x hammer Issues, please refer to the Consolidated Troubleshooting Article for Red Hat Satellite 6.x hammer-related Issues

Diagnostic Steps

Help page shows

[root@sun-x4-2l-1 ~]# hammer -u admin -p changeme 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
Product(s)
Category
Tags

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.