Project

General

Profile

Actions

Bug #18572

closed

Hammer - Unable to remove repo content using repo name if more than one repository with same name exists

Added by Swapnil Abnave about 7 years ago. Updated over 5 years ago.

Status:
Duplicate
Priority:
Normal
Category:
Hammer
Target version:
Difficulty:
easy
Triaged:
Fixed in Releases:
Found in Releases:

Description

Cloned from: https://bugzilla.redhat.com/1413145

Description of problem:
Unable to remove repo content using repo name if more than one repository with same name exists.
If more than one repo with the same name but in different products/organizations exists, it is not possible to remove its content using repo name via hammer.
Most of the `repository` subcommands allows to specify --product/--product-id and --organization/--organization-id but `remove-content` allows to provide only repo's --name or --id.

> 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.
> --name NAME                   Repository name to search by
> -h, --help                    print help
> hammer> 

> repository create --name a --product 1 --content-type yum --url http://inecas.fedorapeople.org/fakerepos/zoo3/ --organization-id 1
> repository create --name a --product 2 --content-type yum --url http://inecas.fedorapeople.org/fakerepos/zoo3/ --organization-id 1
> repository synchronize --name a --product 1 --organization-id 1
> repository synchronize --name a --product 2 --organization-id 1
> repository remove-content --name a --ids 4403  
> Could not remove content:
>  Error: found more than one repository
> repository remove-content --name a --ids 4403 --product 1 --organization-id=1
> Could not remove content:
>  Error: Unrecognised option '--product'

Version-Release number of selected component (if applicable):
Satellite 6.3.0 Snap 8.0 / Foreman 1.13.2.2
tfm-rubygem-hammer_cli_foreman-0.8.0-1

How reproducible:
Always

Steps to Reproduce:
1. Create 2 repos with the same name but in different products
2. Try to remove content providing only repo name
3. Try to remove content providing repo name and product or organization name/id

Actual results:
Error `found more than one repository` or
Error `Unrecognised option '--product`

Expected results:
It should be possible to specify organization/product like for other repository subcommands.


Related issues 1 (0 open1 closed)

Is duplicate of Katello - Bug #15555: Hammer repository remove-content should allow reposotiry ID resolution by name, organization, and productClosedAndrew Kofink06/30/2016Actions
Actions #1

Updated by Dominic Cleal about 7 years ago

  • Project changed from Hammer CLI to Katello
  • Category deleted (Other commands)
Actions #2

Updated by The Foreman Bot about 7 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/hammer-cli-katello/pull/484 added
Actions #3

Updated by Swapnil Abnave about 7 years ago

  • Category set to Hammer
Actions #4

Updated by Eric Helms about 7 years ago

  • translation missing: en.field_release set to 211
Actions #5

Updated by Andrew Kofink about 7 years ago

  • Is duplicate of Bug #15555: Hammer repository remove-content should allow reposotiry ID resolution by name, organization, and product added
Actions #6

Updated by Andrew Kofink about 7 years ago

  • Status changed from Ready For Testing to Duplicate
Actions

Also available in: Atom PDF