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 1905814 - [RFE] Ability to clone a discovery rule from webui
Summary: [RFE] Ability to clone a discovery rule from webui
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Discovery Plugin
Version: 6.8.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: 6.10.0
Assignee: Rahul Bajaj
QA Contact: Roman Plevka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-12-09 06:55 UTC by Amaani S Karimi
Modified: 2024-03-25 17:27 UTC (History)
7 users (show)

Fixed In Version: tfm-rubygem-foreman_discovery-17.0.5-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-16 14:09:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 32176 0 Normal Closed clone a discovery rule 2021-09-21 10:45:44 UTC
Foreman Issue Tracker 33531 0 Normal New When cloning a discovery rule, I'd expect orgs and locs to be prefilled based on the original rule 2021-09-21 11:26:50 UTC
Red Hat Knowledge Base (Solution) 5636401 0 None None None 2020-12-09 07:05:41 UTC
Red Hat Product Errata RHSA-2021:4702 0 None None None 2021-11-16 14:09:44 UTC

Description Amaani S Karimi 2020-12-09 06:55:35 UTC
1. Proposed title of this feature request

>> Ability to clone discovery rules from WebUI


2. What is the nature and description of the request?

>> Just like templates, etc have the ability to clone and create copy, similar functionality if requested for discovery rules.


3. For each functional requirement listed, specify how Red Hat and the customer can test to confirm the requirement is successfully implemented.

>> any

4. Is there already an existing RFE upstream or in Red Hat Bugzilla?

>> No

5. Does the customer have any specific timeline dependencies and which release would they like to target (i.e. RHEL5, RHEL6)?

>> N/A

6. Would the customer be able to assist in testing this functionality if implemented?

>> Yes

Comment 2 Bryan Kearney 2021-04-13 10:14:31 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/32176 has been resolved.

Comment 3 Roman Plevka 2021-07-02 06:34:10 UTC
Failed QA:
sat6.10.0-7.0

The clone dialog does not select the same taxonomies (organizations, locations) as the original Discovery rule has assigned. No taxonomies are selected instead.

Expecting all the attributes and associations to be the same (excepting name).

Comment 5 Roman Plevka 2021-10-06 13:06:32 UTC
FAILED QA
on sat6.10.0-21.0

Now, the clone doesn't work at all - instead, it updates the original discovery rule.

looking at production log, it looks like the request is being generated towards wrong endpoint:

10.40.195.187 - - [06/Oct/2021:09:05:28 -0400] "POST /discovery_rules/1 HTTP/1.1" 302 124 "https://dhcp-2-226.vms.sat.rdu2.redhat.com/discovery_rules/1-dr1-c3-u/clone" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36"
10.40.195.187 - - [06/Oct/2021:09:05:29 -0400] "GET /discovery_rules HTTP/1.1" 200 5952 "https://dhcp-2-226.vms.sat.rdu2.redhat.com/discovery_rules/1-dr1-c3-u/clone" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36"

==> /var/log/foreman/production.log <==
2021-10-06T09:05:28 [I|app|28178fd5] Started PATCH "/discovery_rules/1" for 10.40.195.187 at 2021-10-06 09:05:28 -0400
2021-10-06T09:05:28 [I|app|28178fd5] Processing by DiscoveryRulesController#update as HTML
2021-10-06T09:05:28 [I|app|28178fd5]   Parameters: {"utf8"=>"✓", "authenticity_token"=>"T2ACXEYvCytcgFDwbj74KDdHnURfb/QQC+5fICXIwehKyoc4Ku2Ej9JjC0VPYv/Q8u7LF3VQo86WATkicT7jNQ==", "discovery_rule"=>{"name"=>"dr1-c3-c", "search"=>"cpu_count = 1", "hostgroup_id"=>"1", "hostname"=>"", "max_count"=>"1", "priority"=>"700", "enabled"=>"1", "location_ids"=>["", "4"], "organization_ids"=>["", "3"]}, "commit"=>"Submit", "id"=>"1"}
2021-10-06T09:05:28 [I|aud|28178fd5] DiscoveryRule (1) update event on name dr1-c3-u, dr1-c3-c
2021-10-06T09:05:28 [I|aud|28178fd5] DiscoveryRule (1) update event on priority 600, 700




comparing this to the actual update action, it's absolutely identical:




10.40.195.187 - - [06/Oct/2021:09:04:39 -0400] "POST /discovery_rules/1 HTTP/1.1" 302 124 "https://dhcp-2-226.vms.sat.rdu2.redhat.com/discovery_rules/1-dr1-c3/edit" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36"
10.40.195.187 - - [06/Oct/2021:09:04:40 -0400] "GET /discovery_rules HTTP/1.1" 200 5954 "https://dhcp-2-226.vms.sat.rdu2.redhat.com/discovery_rules/1-dr1-c3/edit" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36"
10.40.195.187 - - [06/Oct/2021:09:04:40 -0400] "GET /webpack/foreman_rh_cloud/foreman_rh_cloud-95858015132025db23c0.css HTTP/1.1" 200 22448 "https://dhcp-2-226.vms.sat.rdu2.redhat.com/discovery_rules" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36"

==> /var/log/foreman/production.log <==
2021-10-06T09:04:39 [I|app|f1d1dd71] Started PATCH "/discovery_rules/1" for 10.40.195.187 at 2021-10-06 09:04:39 -0400
2021-10-06T09:04:39 [I|app|f1d1dd71] Processing by DiscoveryRulesController#update as HTML
2021-10-06T09:04:39 [I|app|f1d1dd71]   Parameters: {"utf8"=>"✓", "authenticity_token"=>"BazJwX1v9YB8732Zd3H4faDNVZ2t0p+6XVYVl02drugABkylEa16JPIMJixWLf+FZWQDzoftyGTAuXOVGWuMNQ==", "discovery_rule"=>{"name"=>"dr1-c3-u", "search"=>"cpu_count = 1", "hostgroup_id"=>"1", "hostname"=>"", "max_count"=>"1", "priority"=>"600", "enabled"=>"1", "location_ids"=>["", "4"], "organization_ids"=>["", "3"]}, "commit"=>"Submit", "id"=>"1"}
2021-10-06T09:04:39 [I|aud|f1d1dd71] DiscoveryRule (1) update event on name dr1-c3, dr1-c3-u

Comment 10 Roman Plevka 2021-10-25 09:36:28 UTC
VERIFIED
on sat6.10-24.0

The discovery rule is now correctly cloned, with incremented priority score

Comment 13 errata-xmlrpc 2021-11-16 14:09:33 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 (Moderate: Satellite 6.10 Release), 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-2021:4702


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