summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell Teague <rteague@redhat.com>2017-07-26 14:26:47 -0400
committerRussell Teague <rteague@redhat.com>2017-07-26 14:26:47 -0400
commite70ca762c7b523bf4f7f9cb9015731f9d6e1688e (patch)
tree03fc4b81779fe5fd9ebe80c9ac2dfc9866514755
parentcff5116a1dae3c6b44afa59ae5fd08b398873945 (diff)
downloadopenshift-e70ca762c7b523bf4f7f9cb9015731f9d6e1688e.tar.gz
openshift-e70ca762c7b523bf4f7f9cb9015731f9d6e1688e.tar.bz2
openshift-e70ca762c7b523bf4f7f9cb9015731f9d6e1688e.tar.xz
openshift-e70ca762c7b523bf4f7f9cb9015731f9d6e1688e.zip
Refactor openshift_facts BIOS vendor discovery
In Ansible 2.4, `get_file_content` is moving from ansible.module_utils.facts to ansible.module_utils.facts.utils However, the method is no longer needed as the BIOS vendor fact can be retrieved from a standard Ansible fact, `ansible_system_vendor`. i.e.: "ansible_system_vendor": "Google",
-rwxr-xr-xroles/openshift_facts/library/openshift_facts.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py
index 49cc51b48..42c4945b4 100755
--- a/roles/openshift_facts/library/openshift_facts.py
+++ b/roles/openshift_facts/library/openshift_facts.py
@@ -2222,14 +2222,10 @@ class OpenShiftFacts(object):
product_version = self.system_facts['ansible_product_version']
virt_type = self.system_facts['ansible_virtualization_type']
virt_role = self.system_facts['ansible_virtualization_role']
+ bios_vendor = self.system_facts['ansible_system_vendor']
provider = None
metadata = None
- # TODO: this is not exposed through module_utils/facts.py in ansible,
- # need to create PR for ansible to expose it
- bios_vendor = get_file_content( # noqa: F405
- '/sys/devices/virtual/dmi/id/bios_vendor'
- )
if bios_vendor == 'Google':
provider = 'gce'
metadata_url = ('http://metadata.google.internal/'