Bug 1416868 - `hammer repository [export|remove-content|update]` is missing organization options
Summary: `hammer repository [export|remove-content|update]` is missing organization op...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Repositories
Version: 6.3.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: Unspecified
Assignee: Andrew Kofink
QA Contact: Brad Buckingham
URL:
Whiteboard:
: 1413145 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-26 16:14 UTC by Andrew Kofink
Modified: 2019-08-12 15:58 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-21 16:54:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 15555 0 Normal Closed Hammer repository remove-content should allow reposotiry ID resolution by name, organization, and product 2021-02-15 16:48:16 UTC

Description Andrew Kofink 2017-01-26 16:14:27 UTC
Description of problem:
Organization options are required to search for a product by name.

Version-Release number of selected component (if applicable):
6.3.0

How reproducible:
Always

Steps to Reproduce:
1. `hammer repository export -h`
2. `hammer repository export --product Zoo --name custom --organization-id 1`

Actual results:
No organization options are listed, and (2.) results in:
Could not export the repository:
  Error: Unrecognised option '--organization-id'
  
  See: 'hammer repository export --help'

Expected results:
Organization options are listed, and (2.) succeeds.

Additional info:

Comment 3 Satellite Program 2017-02-20 19:00:32 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/15555 has been resolved.

Comment 4 Andrew Kofink 2017-03-09 19:46:00 UTC
*** Bug 1413145 has been marked as a duplicate of this bug. ***

Comment 5 Brad Buckingham 2017-08-02 21:30:25 UTC
Verified with Satellite 6.3 SNAP 9: satellite-6.3.0-16.0.beta.el7sat.noarch, tfm-rubygem-katello-3.4.2-1.el7sat.noarch

- verify help output for each command includes organization
- verify that each command executes with organization

hammer> repository export --help
Usage:
     repository export [OPTIONS]

Options:
 --async                                 Do not wait for the task
 --export-to-iso EXPORT_TO_ISO           Export to ISO format
                                         One of true/false, yes/no, 1/0.
 --id ID                                 Repository identifier
 --iso-mb-size ISO_MB_SIZE               maximum size of each ISO in MB
 --name NAME                             Repository name to search by
 --organization ORGANIZATION_NAME        Organization name to search by
 --organization-id ORGANIZATION_ID       Organization ID to search by
 --organization-label ORGANIZATION_LABEL Organization label to search by
 --product PRODUCT_NAME                  Product name to search by
 --product-id PRODUCT_ID                 product numeric identifier
 --since SINCE                           Optional date of last export (ex: 2010-01-01T12:00:00Z)
 -h, --help                              print help


hammer> repository remove-content --help
Usage:
     repository remove-content [OPTIONS]

Options:
 --id ID                                 repository ID
 --ids IDS                               Array of content ids to remove
                                         Comma separated list of values. Values containing comma should be double quoted
 --name NAME                             Repository name to search by
 --organization ORGANIZATION_NAME        Organization name to search by
 --organization-id ORGANIZATION_ID       Organization ID to search by
 --organization-label ORGANIZATION_LABEL Organization label to search by
 --product PRODUCT_NAME                  Product name to search by
 --product-id PRODUCT_ID                 product numeric identifier
 --sync-capsule SYNC_CAPSULE             Whether or not to sync an external capsule after upload. Default: true
                                         One of true/false, yes/no, 1/0.
 -h, --help                              print help


hammer> repository update --help
Usage:
     repository update [OPTIONS]

Options:
 --checksum-type CHECKSUM_TYPE                             checksum of the repository, currently 'sha1' & 'sha256'
                                                           are supported.'
 --docker-upstream-name DOCKER_UPSTREAM_NAME               name of the upstream docker repository
 --download-policy DOWNLOAD_POLICY                         download policy for yum repos (either 'immediate',
                                                           'on_demand', or 'background')
                                                           Possible value(s): 'immediate', 'on_demand', 'background'
 --gpg-key GPG_KEY_NAME                                    Name to search by
 --gpg-key-id GPG_KEY_ID                                   gpg key numeric identifier
 --id ID                                                   repository ID
 --mirror-on-sync MIRROR_ON_SYNC                           true if this repository when synced has to be mirrored from the source and
                                                           stale rpms removed.
                                                           One of true/false, yes/no, 1/0.
 --name NAME                                               Repository name to search by
 --new-name NEW_NAME                                       New name for the repository
 --organization ORGANIZATION_NAME                          Organization name to search by
 --organization-id ORGANIZATION_ID                         Organization ID to search by
 --organization-label ORGANIZATION_LABEL                   Organization label to search by
 --ostree-upstream-sync-depth OSTREE_UPSTREAM_SYNC_DEPTH   if a custom sync policy is chosen for ostree repositories then a
                                                           'depth' value must be provided.
 --ostree-upstream-sync-policy OSTREE_UPSTREAM_SYNC_POLICY policies for syncing upstream ostree repositories.
                                                           Possible value(s): 'latest', 'all', 'custom'
 --product PRODUCT_NAME                                    Product name to search by
 --product-id PRODUCT_ID                                   product numeric identifier
 --publish-via-http ENABLE                                 Publish Via HTTP
                                                           One of true/false, yes/no, 1/0.
 --upstream-password UPSTREAM_PASSWORD                     Password of the upstream repository user for authentication
 --upstream-username UPSTREAM_USERNAME                     Username of the upstream repository user for authentication
 --url URL                                                 the feed url of the original repository
 --verify-ssl-on-sync VERIFY_SSL_ON_SYNC                   if true, Katello will verify the upstream url's SSL certifcates are
                                                           signed by a trusted CA.
                                                           One of true/false, yes/no, 1/0.
 -h, --help                                                print help


hammer> repository export --product zoo --name zoo --organization-id 3
[...................................................................] [100%]
hammer> 


hammer> repository remove-content --product zoo --name zoo --organization-id 3 --ids 357aa782-9c06-4b80-897b-da4e642ee63f
Repository content removed
hammer> 


hammer> repository update --product zoo --name zoo --organization-id 3 --new-name zoo-updated
Repository updated

Comment 6 Satellite Program 2018-02-21 16:54:17 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/RHSA-2018:0336


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