Bug 1269723

Summary: virt-who still can update the mapping info to Stage Candlepin with an wrong env option
Product: [Community] Candlepin Reporter: Filip Nguyen <fnguyen>
Component: candlepinAssignee: Filip Nguyen <fnguyen>
Status: CLOSED DUPLICATE QA Contact: John Sefler <jsefler>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.2CC: fnguyen, gxing, hsun, sgao, shihliu
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-10-08 11:23:38 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 Filip Nguyen 2015-10-08 04:59:18 UTC
Original reporter of this is hsun


Description of problem:
If I set an wrong env option, the virt-who still can update the mapping info to stage candlepin, no any error message output.... 

Version-Release number of selected component (if applicable):
 - RHEL6.7-20150617.0-Client-x86_64(KVM) against Stage Candlepin
 - subscription-manager-1.14.10-1.el6.x86_64
 - virt-who-0.12-10.el6.noarch
 - libvirt-0.10.2-54.el6.x86_64
 - python-rhsm-1.14.3-1.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1. stop virt-who service
# /etc/init.d/virt-who stop
# ps -ef |grep virt-who

2. start virt-who with the right libvirt-env value [--libvirt-env=7616313]
# virt-who --libvirt --libvirt-owner=7616313 --libvirt-env=7616313 --libvirt-server=10.66.128.11 --libvirt-username=root --libvirt-password=redhat -o -d
2015-06-26 17:09:17,557 INFO: Using configuration "env/cmdline" ("libvirt" mode)
2015-06-26 17:09:17,694 INFO: Protocol is not specified in libvirt url, using qemu+ssh://
2015-06-26 17:09:17,695 INFO: Libvirt path is not specified in the url, using /system
2015-06-26 17:09:17,695 INFO: Using libvirt url: qemu+ssh://root.128.11/system?no_tty=1
2015-06-26 17:09:18,105 DEBUG: Virtual machine found: rhel-7.1: 02ac41dc-a755-e14d-e09d-0c2fb476b26f
2015-06-26 17:09:18,110 DEBUG: Virtual machine found: 128-11-rhel-7.1: 34aa5936-b297-34ec-0525-022ad4c06927
2015-06-26 17:09:18,111 DEBUG: Libvirt domains found: [{'guestId': '02ac41dc-a755-e14d-e09d-0c2fb476b26f', 'attributes': {'active': 1, 'virtWhoType': 'libvirt', 'hypervisorType': 'QEMU'}, 'state': 1}, {'guestId': '34aa5936-b297-34ec-0525-022ad4c06927', 'attributes': {'active': 1, 'virtWhoType': 'libvirt', 'hypervisorType': 'QEMU'}, 'state': 1}]
2015-06-26 17:09:18,150 INFO: Sending update in hosts-to-guests mapping: {'a84038db-b8f6-de11-ab4f-34cfc47eebf6': [{'guestId': '02ac41dc-a755-e14d-e09d-0c2fb476b26f', 'attributes': {'active': 1, 'virtWhoType': 'libvirt', 'hypervisorType': 'QEMU'}, 'state': 1}, {'guestId': '34aa5936-b297-34ec-0525-022ad4c06927', 'attributes': {'active': 1, 'virtWhoType': 'libvirt', 'hypervisorType': 'QEMU'}, 'state': 1}]}
2015-06-26 17:09:18,150 DEBUG: Authenticating with certificate: /etc/pki/consumer/cert.pem
2015-06-26 17:09:24,147 INFO: virt-who host/guest association update successful
2015-06-26 17:09:24,147 DEBUG: Association for config env/cmdline gathered
2015-06-26 17:09:24,148 DEBUG: virt-who shut down started

3. start virt-who with the right libvirt-env value [--libvirt-env=xxxxxxxx]
# virt-who --libvirt --libvirt-owner=7616313 --libvirt-env=xxxxxxxx --libvirt-server=10.66.128.11 --libvirt-username=root --libvirt-password=redhat -o -d
2015-06-26 17:10:52,389 INFO: Using configuration "env/cmdline" ("libvirt" mode)
2015-06-26 17:10:52,501 INFO: Protocol is not specified in libvirt url, using qemu+ssh://
2015-06-26 17:10:52,502 INFO: Libvirt path is not specified in the url, using /system
2015-06-26 17:10:52,502 INFO: Using libvirt url: qemu+ssh://root.128.11/system?no_tty=1
2015-06-26 17:10:52,880 DEBUG: Virtual machine found: rhel-7.1: 02ac41dc-a755-e14d-e09d-0c2fb476b26f
2015-06-26 17:10:52,886 DEBUG: Virtual machine found: 128-11-rhel-7.1: 34aa5936-b297-34ec-0525-022ad4c06927
2015-06-26 17:10:52,887 DEBUG: Libvirt domains found: [{'guestId': '02ac41dc-a755-e14d-e09d-0c2fb476b26f', 'attributes': {'active': 1, 'virtWhoType': 'libvirt', 'hypervisorType': 'QEMU'}, 'state': 1}, {'guestId': '34aa5936-b297-34ec-0525-022ad4c06927', 'attributes': {'active': 1, 'virtWhoType': 'libvirt', 'hypervisorType': 'QEMU'}, 'state': 1}]
2015-06-26 17:10:52,928 INFO: Sending update in hosts-to-guests mapping: {'a84038db-b8f6-de11-ab4f-34cfc47eebf6': [{'guestId': '02ac41dc-a755-e14d-e09d-0c2fb476b26f', 'attributes': {'active': 1, 'virtWhoType': 'libvirt', 'hypervisorType': 'QEMU'}, 'state': 1}, {'guestId': '34aa5936-b297-34ec-0525-022ad4c06927', 'attributes': {'active': 1, 'virtWhoType': 'libvirt', 'hypervisorType': 'QEMU'}, 'state': 1}]}
2015-06-26 17:10:52,929 DEBUG: Authenticating with certificate: /etc/pki/consumer/cert.pem
2015-06-26 17:10:59,495 INFO: virt-who host/guest association update successful
2015-06-26 17:10:59,495 DEBUG: Association for config env/cmdline gathered
2015-06-26 17:10:59,496 DEBUG: virt-who shut down started


Actual results:
with an wrong libvirt-env value, virt-who also can send the mapping info normally.

Expected results:
with an wrong libvirt-env value, virt-who should show the error or warning message, and don't send the mapping info to stage candlepin

Additional info:

Comment 1 Filip Nguyen 2015-10-08 05:00:24 UTC
*** Bug 1235980 has been marked as a duplicate of this bug. ***

Comment 3 Radek Novacek 2015-10-08 06:17:14 UTC
How can virt-who know that the env is incorrect? I think that candlepin should check the env and report an error back to virt-who. Do you agree? If so I'll move this bug to candlepin.

Comment 4 Filip Nguyen 2015-10-08 07:31:59 UTC
Yes you are correct. I didn't realize that the --libvirt-env value is being sent to the server. I will look into this.

Comment 5 Filip Nguyen 2015-10-08 11:23:38 UTC
Ah clearning up the mess I made by moving this bug back and forth between components and duplicating it.

*** This bug has been marked as a duplicate of bug 1235980 ***