Bug 1379677 - repository delete by name neither allows to delete repo w/o org nor accepts the org
Summary: repository delete by name neither allows to delete repo w/o org nor accepts t...
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: Justin Sherrill
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-27 12:24 UTC by Sachin Ghai
Modified: 2019-09-25 21:26 UTC (History)
4 users (show)

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


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 16730 0 None None None 2016-09-28 14:52:30 UTC

Description Sachin Ghai 2016-09-27 12:24:21 UTC
Description of problem:

repository delete --help doesn't show any option --organization or organization-id

~]# hammer -u admin -p changeme repository delete --help
Usage:
    hammer repository delete [OPTIONS]

Options:
 --id ID                        
 --name NAME                   Repository name to search by
 --product PRODUCT_NAME        Product name to search by
 --product-id PRODUCT_ID       product numeric identifier
 -h, --help                    print help

atomic_f23 repo is already there

 ~]# hammer -u admin -p changeme repository list --organization-id=1 | grep atomic_f23
4  | atomic_f23                                             | atomic                               | ostree       | https://kojipkgs.fedoraproject.org/atomic/23/          


If we don't pass --organization, hammer raises error couldn't find org

~]# hammer -u admin -p changeme repository delete --name atomic_f23 --product atomic
Could not delete the Repository:
  Error: Could not find organization. Some search options were missing, please see --help.


if we pass org, it says unrecognized option

~]# hammer -u admin -p changeme repository delete --name atomic_f23 --product atomic --organization-ids=1
Could not delete the Repository:
  Error: Unrecognised option '--organization-ids'


~]# hammer -u admin -p changeme repository delete --name atomic_f23 --product atomic --organization-id=1
Could not delete the Repository:
  Error: Unrecognised option '--organization-id'

~]# hammer -u admin -p changeme repository delete --name atomic_f23 --product atomic --organization='Default Organization'
Could not delete the Repository:
  Error: Unrecognised option '--organization'



Version-Release number of selected component (if applicable):
sat6.3 snap2

How reproducible:


Steps to Reproduce:
1. delete a repository with repo name and product name
2.
3.

Actual results:
repository delete by name neither allows to delete repo w/o org nor accepts the org

Expected results:
help should list the --organization/--organization-id parameter if its required otherwise repo should be deleted successfully w/o org

Additional info:

Comment 2 Brad Buckingham 2016-09-28 14:52:28 UTC
Created redmine issue http://projects.theforeman.org/issues/16730 from this bug

Comment 3 Bryan Kearney 2016-10-04 16:19:24 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/16730 has been resolved.

Comment 4 Justin Sherrill 2017-08-02 15:40:23 UTC
Verified in 6.3.0 Snap 9:

# hammer -p changeme repository delete --name zoo --product product --organization=Default\ Organization
Repository deleted


# hammer -p changeme repository delete --name zoo
Could not delete the Repository:
  Error: At least one of options --product, --product-id is required

# hammer -p changeme repository delete --name zoo --product product
Could not delete the Repository:
  Error: Could not find organization. Some search options were missing, please see --help.


# hammer -p changeme repository delete --help
Usage:
    hammer repository delete [OPTIONS]

Options:
 --id ID                                  
 --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
 -h, --help                              print help

Comment 5 pm-sat@redhat.com 2018-02-21 16:49:54 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.