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 1460793 - hammer CLI discovery_rules create does not pass organizations_id with request
Summary: hammer CLI discovery_rules create does not pass organizations_id with request
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Discovery Plugin
Version: 6.2.9
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: Unspecified
Assignee: Lukas Zapletal
QA Contact: Roman Plevka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-06-12 19:05 UTC by Keith Resar
Modified: 2018-09-04 17:47 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-09-04 17:47:15 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Keith Resar 2017-06-12 19:05:50 UTC
Description of problem:
Using the hammer CLI to create discovery rules fails with an error related to missing organizatrions_id.  Hammer is not passing along the default organization ID nor are command line options documented that allow specifying this.

Discovery rules cannot be created without tying to a specific organization ID.

Version-Release number of selected component (if applicable):
Satellite version 6.2.9
Hammer version 0.5.1.13

How reproducible:
Always.

Steps to Reproduce:
1. hammer -d discovery_rule create --hostgroup $hostgroup --name MyDiscoveryRule --search "organization = lab"
2. 
3.

Actual results:
Returns http 422 error "Organizations Host group organization lab must also be associated to the discovery rule"

Expected results:
Discovery rule created.

Additional info:

Run in debug I see the following params provided in the API POST request:
    "discovery_rule" => {
                "name" => "MyDiscoveryRule",
              "search" => "organization = lab",
        "hostgroup_id" => 2
    }

If I run the following direct API query the discovery_rule is created since the organization_ids are provided.

curl -X POST -H "Accept:application/json,version=2" -H "Content-Type:application/json" -s -k -u user:password -d "{\"name\":\"MyDiscoveryRule\", \"search\":\"organization = lab\",\"hostgroup_id\":2, \"organization_ids\": [1]}" https://satelliteserver/api/v2/discovery_rules

Comment 5 Bryan Kearney 2018-09-04 17:47:15 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and we do not expect this to be implemented in the product in the foreseeable future. We are therefore closing this out as WONTFIX. If you have any concerns about this, please feel free to contact Rich Jerrido or Bryan Kearney. Thank you.


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