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 1517123 - virt-who doesn't validate file contents and file name leading to duplicate config
Summary: virt-who doesn't validate file contents and file name leading to duplicate co...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Virt-who Configure Plugin
Version: 6.3.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: Unspecified
Assignee: Marek Hulan
QA Contact: Peter Ondrejka
satellite-doc-list
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-24 09:32 UTC by Harshad More
Modified: 2019-09-26 16:10 UTC (History)
5 users (show)

Fixed In Version: foreman_virt_who_configure-0.1.9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-21 16:54:37 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
form screenshot (10.66 KB, image/png)
2018-01-03 17:06 UTC, Peter Ondrejka
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 21773 0 None None None 2017-11-27 10:40:14 UTC

Description Harshad More 2017-11-24 09:32:27 UTC
Description of problem:

Using Virt-who Configurations plugin to create new configuration leads to duplicate config if created config same as old one on satellite 6.3 server.

Version-Release number of selected component (if applicable):

satellite 6.3.0 25.0
virt-who-0.19-6.el7_4.noarch
foreman-1.15.6.9-1.el7sat.noarch

How reproducible:

Always

Steps to Reproduce:
1. Infrastructure --> Virt-who Configurations --> Create Config
2. Fill all the details and submit
3. Again follow steps 1 and 2

Actual results:

Creates two configuration files with same name

Expected results:

Should give error while creating new config file which has same contents as old one.

Additional info:

# ll
total 16
-rw-r--r--. 1 root root 1213 Jul 22 02:16 template.conf
-rw-r--r--. 1 root root  485 Nov 24 12:16 virt-who-config-1.conf
-rw-r--r--. 1 root root  602 Nov 24 12:26 virt-who-config-2.conf
-rw-r--r--. 1 root root  485 Nov 24 14:18 virt-who-config-3.conf
# pwd
/etc/virt-who.d

# diff virt-who-config-1.conf virt-who-config-3.conf
3c3
< [virt-who-config-1]
---
> [virt-who-config-3]
12,13c12,13
< rhsm_username=virt_who_reporter_1
< rhsm_encrypted_password=8aa98b69ebfddac99e9239d3f93604d8b1e502cb24b051c89a141e29e31f0582
---
> rhsm_username=virt_who_reporter_3
> rhsm_encrypted_password=a7713acc7262a086c9fa57ba5b914189ebe1ff712c611f3fa83a29ba3d2a5c85

--------------------
# cat virt-who-config-1.conf
### This configuration file is managed via the virt-who configure plugin
### manual edits will be deleted.
[virt-who-config-1]
type=esx
hypervisor_id=hostname
owner=RedHat
env=Library
server=vmware-1.xxx.redhat.com
username=satadmin
encrypted_password=ea5c98bfec1784e4860a102026eb71ac
rhsm_hostname=vm250-75.xxx.com
rhsm_username=virt_who_reporter_1
rhsm_encrypted_password=8aa98b69ebfddac99e9239d3f93604d8b1e502cb24b051c89a141e29e31f0582
rhsm_prefix=/rhsm

Comment 2 Marek Hulan 2017-11-24 13:27:17 UTC
Why is this an issue? It might be necessary to create 2 configs for the same hypervisor, e.g. with only different whitelist/blacklist. Or is that only a name that you'd like to be unique?

Comment 3 Harshad More 2017-11-27 09:12:31 UTC
(In reply to Marek Hulan from comment #2)
> Why is this an issue? It might be necessary to create 2 configs for the same
> hypervisor, e.g. with only different whitelist/blacklist. Or is that only a
> name that you'd like to be unique?

------------------------------------------------------------

Yes, name should be unique to the config.

Additionally, for one configuration we can have either whitelist or backlist and not both. So need to be taken care or some message should be pop-up

Comment 4 Marek Hulan 2017-11-27 10:40:11 UTC
Created redmine issue http://projects.theforeman.org/issues/21773 from this bug

Comment 5 Marek Hulan 2017-11-27 10:43:03 UTC
I do not understand the second commit. You need to chose filtering mode. Either unlimited, whitelist or blacklist, I don't see a way you could have two at the same time. Anyway that should be a separate BZ, so if you see some issue there, please create a new report.

Comment 8 Marek Hulan 2017-11-27 11:04:57 UTC
The patch adds a uniqueness check but note it's per organization only. So two organizations can have the configuration with the same name. Therefore as a user in any context you could still see two records in a table with the same name. That is however correct.

Comment 9 Satellite Program 2017-12-08 15:13:36 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/21773 has been resolved.

Comment 10 Peter Ondrejka 2018-01-03 17:06:35 UTC
Created attachment 1376531 [details]
form screenshot

Verified on Sat 6.3 snap 30, virt-who config dialog now validates name for uniqueness

Comment 11 Satellite Program 2018-02-21 16:54:37 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:0336


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