Project

General

Profile

Bug #24023

hammer content-view create --repositories doesn't work with --name

Added by Christine Fouant about 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Category:
Hammer
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1585993

Description of problem:
whenever i try to create a content view with repositories attached to it (in a single command), it fails:

  1. hammer -u admin -p changeme --output=csv content-view create --product="qZUFXCqgiIwMirUQuLZH" --organization-id="134" --repositories="HLWrPBJDOVDVyal" --name="foo"
    Could not create the content view:
    Error: one of repositories not found.

the issues seems to be with using --repositories together with --name option.
While --name parameter is required (content view name), when --repositories is used, hammer uses the value of --name while querying for the repositories, which obviously yields 0 results:

  1. hammer -d -u admin -p changeme --output=csv content-view create --product="qZUFXCqgiIwMirUQuLZH" --organization-id="134" --repositories="HLWrPBJDOVDVyal" --name="foo"
    ...
    ...
    [ INFO 2018-06-05T05:06:53 API] GET /katello/api/products/889/repositories
    [DEBUG 2018-06-05T05:06:53 API] Params: {
    "name" => "foo",
    "names" => [
    [0] "HLWrPBJDOVDVyal"
    ]
    }
    [DEBUG 2018-06-05T05:06:53 API] Headers: {
    :params => {
    "name" => "foo",
    "names" => [
    [0] "HLWrPBJDOVDVyal"
    ]
    }
    }

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

How reproducible:
always

Steps to Reproduce:
1. # hammer -d -u admin -p changeme --output=csv content-view create --product="qZUFXCqgiIwMirUQuLZH" --organization-id="134" --repositories="HLWrPBJDOVDVyal" --name="foo"

Actual results:
unable to locate the repositories as hammer puts the content-view name into the search query.

this is a regression from 6.3

Associated revisions

Revision 1dc05861 (diff)
Added by Christine Fouant about 3 years ago

fixes #24023 - removes singular name param names array exists (#564)

History

#1 Updated by The Foreman Bot about 3 years ago

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

#2 Updated by Christine Fouant about 3 years ago

  • % Done changed from 0 to 100
  • Status changed from Ready For Testing to Closed

#3 Updated by Andrew Kofink about 3 years ago

  • Legacy Backlogs Release (now unused) set to 338

Also available in: Atom PDF