Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1585993 - hammer content-view create --repositories doesn't work with --name
Summary: hammer content-view create --repositories doesn't work with --name
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer - Content
Version: 6.4
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.4.0
Assignee: Christine Fouant
QA Contact: Roman Plevka
URL:
Whiteboard:
: 1597046 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-06-05 09:08 UTC by Roman Plevka
Modified: 2019-11-05 23:22 UTC (History)
3 users (show)

Fixed In Version: tfm-rubygem-hammer_cli_katello-0.13.3-1.el7sat
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-16 19:08:01 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 24023 0 None None None 2018-06-20 19:12:51 UTC

Description Roman Plevka 2018-06-05 09:08:39 UTC
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

Comment 2 Christine Fouant 2018-06-20 19:12:50 UTC
Created redmine issue https://projects.theforeman.org/issues/24023 from this bug

Comment 3 Satellite Program 2018-06-22 14:26:03 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/24023 has been resolved.

Comment 4 Roman Plevka 2018-07-11 08:30:19 UTC
VERIFIED
on sat6.4.0-11

# hammer -d -u admin -p changeme --output=csv content-view create --product="prod" --organization-id="1" --repositories="repo" --name="cv"
...
[ INFO 2018-07-11T04:28:21 API] GET /katello/api/products/276/repositories
[DEBUG 2018-07-11T04:28:21 API] Params: {
    "names" => [
        [0] "repo"
    ]
}
...
[ INFO 2018-07-11T04:28:22 API] POST /katello/api/organizations/1/content_views
[DEBUG 2018-07-11T04:28:22 API] Params: {
              "name" => "cv",
    "repository_ids" => [
        [0] 122
    ],
         "composite" => false
}

...
Message,Id,Name
Content view created,81,cv

# hammer content-view info --id 81
ID:                           81
Name:                         cv
Label:                        cv
Composite:                    false
Description:                  
Content Host Count:           0
Organization:                 Default Organization
Yum Repositories:             
 1) ID:    122
    Name:  repo
    Label: repo
...

Comment 5 Christine Fouant 2018-07-13 12:37:45 UTC
*** Bug 1597046 has been marked as a duplicate of this bug. ***

Comment 6 Bryan Kearney 2018-10-16 19:08:01 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:2927


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