Bug #24023
closedhammer content-view create --repositories doesn't work with --name
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:
- 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:
- 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