Bug 1367957

Summary: virt-who still can be started when without env/owner in /etc/virt-who.d/xxx
Product: Red Hat Enterprise Linux 7 Reporter: Liushihui <shihliu>
Component: virt-whoAssignee: Radek Novacek <rnovacek>
Status: CLOSED DUPLICATE QA Contact: Eko <hsun>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.3CC: gxing, ovasik, sgao
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-18 02:34:48 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:

Description Liushihui 2016-08-18 02:24:47 UTC
Description of problem:
When virt-who without env or owner to work with stage candlepin, it still can be started.

Version-Release number of selected component (if applicable):
virt-who-0.17-7.el7.noarch
subscription-manager-1.17.10-1.el7.x86_64
python-rhsm-1.17.6-1.el7.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Register to stage candlepin.
2. In /etc/virt-who.d/XXX, it hasn't configure env/owner
# cat /etc/virt-who.d/virt-who
[xen]
type=xen
server=10.73.131.183
username=root
password=Welcome1
owner=
env=7970632
2. Restart virt-who service.
# systemctl restart virt-who.service
2016-08-17 14:36:18,133 - entitlement - INFO - <<<Return Code: 0
3. Check virt-who's status.
systemctl status virt-who.service
2016-08-17 14:36:18,961 - entitlement - INFO - <<<Return Code: 0
2016-08-17 14:36:18,961 - entitlement - INFO - <<<Output:
● virt-who.service - Daemon for reporting virtual guest IDs to subscription-manager
   Loaded: loaded (/usr/lib/systemd/system/virt-who.service; disabled; vendor preset: disabled)
   Active: active (running) since Wed 2016-08-17 14:36:19 EDT; 825ms ago
 Main PID: 17953 (virt-who)
   CGroup: /system.slice/virt-who.service
           ├─17953 /usr/bin/python2 /usr/bin/virt-who
           └─17960 /usr/bin/python2 /usr/bin/virt-who
4. Check virt-who's log , it will show error info to remind without env/owner
"Unable to send data: Communication with subscription manager failed with code 404: Organization with id  could not be found."


Actual results:
Virt-who still can be started when without env/owner in /etc/virt-who.d/xxx.

Expected results:
Virt-who shouldn't be started when without env/owner, the expect result should the same as it work with SAM. please see detail as the following:

1. Restart virt-who service.
# systemctl restart virt-who.service
Job for virt-who.service failed because the control process exited with error code. See "systemctl status virt-who.service" and "journalctl -xe" for details.
2. Check virt-who's status.
# systemctl status virt-who.service
2016-08-17 14:49:16,301 - entitlement - INFO - <<<Return Code: 3
2016-08-17 14:49:16,301 - entitlement - INFO - <<<Output:
● virt-who.service - Daemon for reporting virtual guest IDs to subscription-manager
   Loaded: loaded (/usr/lib/systemd/system/virt-who.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2016-08-17 14:49:13 EDT; 3s ago
  Process: 16737 ExecStart=/usr/bin/virt-who (code=exited, status=1/FAILURE)
 Main PID: 16737 (code=exited, status=1/FAILURE)
   Status: "virt-who failed: Option `owner` needs to be set in config `hyperv`"


Additional info:
When it hasn't configure env/owner in /etc/sysconfig/virt-who against stage candlpin or SAM, it hasn't this problem.
When it hasn't configure env/owner in /etc/virt-who.d/XXX against SAM, it hasn't this problem.

Comment 1 Liushihui 2016-08-18 02:34:48 UTC

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