Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1156468

Summary: SAM 1.4 Enhanced Reporting: spacewalk-splice-checkin --splice-sync returns "KeyError: 'network.hostname'"
Product: [Retired] Subscription Asset Manager Reporter: Masaki Furuta ( RH ) <mfuruta>
Component: spacewalk-splice-toolAssignee: Katello Internal Mailing List <katello-internal>
Status: CLOSED WONTFIX QA Contact: Katello QA List <katello-qa-list>
Severity: high Docs Contact:
Priority: high    
Version: 1.4CC: aathomas, ajanorka, bkearney, chrobert, ifloodmu, jalviso, jko, katello-internal, mklika, nrathod, pwayper, xdmoon
Target Milestone: rcKeywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-06-27 11:36:41 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:
Attachments:
Description Flags
70-katello.dump
none
60-candlepin.dump
none
50-consumer.txt
none
40-consumer_facts.txt
none
30-splice-debug.tar.gz
none
20-sosreport-nu-sam.01183313-20140919164534-a83a.tar.xz
none
10-katello-debug-20140919162739.tar.gz
none
katello-debug-20140919162739.var.log.thumbslug.error.log.xz none

Comment 2 Masaki Furuta ( RH ) 2014-10-24 14:29:59 UTC
Created attachment 950392 [details]
70-katello.dump

Comment 3 Masaki Furuta ( RH ) 2014-10-24 14:31:40 UTC
Created attachment 950393 [details]
60-candlepin.dump

Comment 4 Masaki Furuta ( RH ) 2014-10-24 14:32:11 UTC
Created attachment 950394 [details]
50-consumer.txt

Comment 5 Masaki Furuta ( RH ) 2014-10-24 14:32:45 UTC
Created attachment 950395 [details]
40-consumer_facts.txt

Comment 6 Masaki Furuta ( RH ) 2014-10-24 14:33:10 UTC
Created attachment 950396 [details]
30-splice-debug.tar.gz

Comment 7 Masaki Furuta ( RH ) 2014-10-24 14:40:37 UTC
Created attachment 950398 [details]
20-sosreport-nu-sam.01183313-20140919164534-a83a.tar.xz

Comment 8 Masaki Furuta ( RH ) 2014-10-24 14:44:03 UTC
Created attachment 950399 [details]
10-katello-debug-20140919162739.tar.gz

Comment 9 Masaki Furuta ( RH ) 2014-10-24 14:47:02 UTC
Created attachment 950400 [details]
katello-debug-20140919162739.var.log.thumbslug.error.log.xz

Comment 11 Paul Wayper 2014-11-04 22:47:02 UTC
Hi all,

I have more information about this, and hopefully it's reproducible.

The problem is that there are machines in the candlepin database with no network.hostname fact.  Where did these machines come from?  They're hypervisors and they were added automatically to the database by virt-who as part of its process of scanning data from (in this case) vCenter.

So on the one hand, maybe virt-who should be supplying more information (how?) so that the machines also get a network.hostname fact and that satisfies spacewalk-splice-checkin.

On the other hand, maybe spacewalk-splice-checkin should cope better with hosts that have no network.hostname fact, as this may be unavoidable if virt-who can't get the necessary details from the hypervisor management.

Hope this helps,

Paul

Comment 12 Paul Wayper 2014-11-05 00:34:32 UTC
I can see the simplest way to solve the immediate problem the customer encounters is:

diff --git a/src/spacewalk_splice_tool/checkin.py b/src/spacewalk_splice_tool/checkin.py
index 10d958c..e12f72d 100644
--- a/src/spacewalk_splice_tool/checkin.py
+++ b/src/spacewalk_splice_tool/checkin.py
@@ -239,7 +239,8 @@ def splice_sync(options):
     # create the base marketing usage list
     mpu_list = []
     for katello_consumer in katello_consumers:
-        mpu_list.append(dt.transform_to_rcs(katello_consumer, sps.get_splice_server_uuid()))
+        if 'facts' in katello_consumer and 'network.hostname' in katello_consumer['facts']:
+            mpu_list.append(dt.transform_to_rcs(katello_consumer, sps.get_splice_server_uuid()))
     # strip out blank values that we don't want to send to splice
     mpu_list = filter(None, mpu_list)
 
In other words, to only add a consumer to the mpu_list if it has the 'network.hostname' fact.  This relies on the dicts working correctly (i.e. if they're mapped back to database queries behind the scenes, then that should query the database correctly).  It also assumes that all other properties (e.g. owner->key and owner->displayName) are present.

Hope this helps,

Paul

Comment 27 jalviso 2016-04-18 02:07:57 UTC
Hi,

Do we have a status update on this case?

Regards,

Josephine

Comment 31 Neeraj Rathod 2017-01-17 04:59:42 UTC
Hi Team,

It seems that many engineers are waiting for an update to provide it to customer. Can someone provide an ETA on this.

Regards,

Neeraj Rathod.

Comment 35 Bryan Kearney 2017-06-26 20:35:37 UTC
The release of Satellite 5.8 we are deprecating the support of Subscription Asset Manager. The release notes for 5.8 can be found at https://access.redhat.com/documentation/en-us/red_hat_satellite/5.8/pdf/release_notes/Red_Hat_Satellite-5.8-Release_Notes-en-US.pdf.

I am therefore closing out this bug as WONTFIX. If you believe this to be an error, please feel free tor each out to either Rich Jerrido or Bryan Kearney. Thank you!