Bug 1451142
Summary: | service now integrations for determining host_name return empty array | |||
---|---|---|---|---|
Product: | Red Hat CloudForms Management Engine | Reporter: | Jeffrey Cutter <jcutter> | |
Component: | Automate | Assignee: | William Fitzgerald <wfitzger> | |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Tasos Papaioannou <tpapaioa> | |
Severity: | high | Docs Contact: | ||
Priority: | high | |||
Version: | 5.7.0 | CC: | cpelland, jcutter, jhardy, kmorey, mkanoor, obarenbo, simaishi, tfitzger, tpapaioa | |
Target Milestone: | GA | Keywords: | TestOnly, ZStream | |
Target Release: | 5.9.0 | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | 5.9.0.1 | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 1462309 1465084 (view as bug list) | Environment: | ||
Last Closed: | 2018-03-06 15:25:25 UTC | Type: | Bug | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | CFME Core | Target Upstream Version: | ||
Embargoed: | ||||
Bug Depends On: | ||||
Bug Blocks: | 1462309, 1465084 |
Description
Jeffrey Cutter
2017-05-15 22:54:00 UTC
After a bit of research I am sorry to say this is not the correct solution. The host_name property on the VM object is not what you would expect. It actually returns the name of the associated host. (Poorly named and we may need to consider changing, but it has been around for a long time so that may make it difficult.) The hostnames is the proper value since that looks up VM's host_names based on the networking data collected during the refresh. So the question is what should this code be doing if we do not have a valid VM hostname? Should it loop to see if one becomes available or exit with an error? Also wanted to let you know that for your rails console example you can avoid loading all the VM objects by calling: $evm.vmdb(:vm).first This will avoid having to load every VM object and they only use one. Should be much quicker, depending on the size of your environment. It doeesn't really matter to me where it comes from, only that it has a valid value. [] didn't work for the customer and we were able to work around the issue using .host_name understanding that may not be the intended value, it was what the customer seemed to be expecting. I often use .first, but in this case, the .first wasn't helpful and it's just my small lab, so I went to the second one. Thanks, -Jeff New commit detected on cfme_productization/master: https://code.engineering.redhat.com/gerrit/gitweb?p=cfme_productization.git;a=commit;h=30f4966cfaaa8c8a655256751b2e80b277daa365 commit 30f4966cfaaa8c8a655256751b2e80b277daa365 Author: william fitzgerald <wfitzger> AuthorDate: Fri May 19 12:27:23 2017 -0400 Commit: william fitzgerald <wfitzger> CommitDate: Fri May 19 12:27:23 2017 -0400 Automate - Modified 3 methods for host_name in RedHat domain. host_name was receiving null values. The Service Now integrations create, update, and update_patch located in: / RedHat / Integration / ServiceNow / CMDB https://bugzilla.redhat.com/show_bug.cgi?id=1451142 .../RedHat/Integration/ServiceNow/CMDB.class/__methods__/create.rb | 6 +++++- .../RedHat/Integration/ServiceNow/CMDB.class/__methods__/update.rb | 6 +++++- .../Integration/ServiceNow/CMDB.class/__methods__/update_patch.rb | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) Verified on 5.9.0.11. |