Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1709450

Summary: hammer import-templates does not update settings when run repeatedly
Product: Red Hat Satellite Reporter: Peter Ondrejka <pondrejk>
Component: ReportingAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED NOTABUG QA Contact: Peter Ondrejka <pondrejk>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.5.0CC: inecas, mhulan, oprazak
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-10-29 15:24:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Peter Ondrejka 2019-05-13 15:36:53 UTC
Description of problem:
When running hammer import-templates several times with changed parameters, the templates are not updated -- settings from the first run still hold

Version-Release number of selected component (if applicable):
Satellite 6.5, 6.6 as well

How reproducible:
always

Steps to Reproduce:
1. run the following command

hammer import-templates --prefix 'Community - '  \
                        --filter '.*statuses$' \
                        --branch ea0a9cdac724a49aa6d0b89108927c6cd2c7cc50  \

2. Note that new report template is displayed in Satellite UI under Any Org / Any Location context
3. Rerun the command with org and loc specified:

hammer import-templates --prefix 'Community - '  \
                        --filter '.*statuses$' \
                        --branch ea0a9cdac724a49aa6d0b89108927c6cd2c7cc50  \
                        --organization 'Default Organization' \
                        --location 'Default Location'

Import successful message is displayed.

4. View Monitor > Report Templates under Default Organization and Default Location the template is not displayed, it is still under any context. It is necessary to delete the previous import to have the next run actually complete. 

Actual results:
described above

Expected results:
Either the parameters should be updated on repeating run, or a message should be displayed with warning that the update was not done

Additional info:

Comment 4 Marek Hulan 2019-05-17 13:14:47 UTC
You need to use --organization-ids, not --organization-id, that is for setting the current context. The command help says " --organization-ids ORGANIZATION_IDS       REPLACE organizations with given ids."  The organization-id only says " --organization-id ORGANIZATION_ID         Organization ID" which is not overly helpful but I think we track there elsewhere already. Mind to retest with -ids param and close if it works?

Comment 5 Peter Ondrejka 2019-10-29 15:24:20 UTC
works with --organizations --locations, closing with help clarification tracked in different bz