From b861083dfbfc143dc234d00ee88cf7f8b4727a05 Mon Sep 17 00:00:00 2001 From: Robin Roth Date: Wed, 27 Apr 2016 09:29:39 +0200 Subject: [PATCH] move machine_id back to Facts class --- lib/ansible/module_utils/facts.py | 8 ++++---- lib/ansible/modules/core | 2 +- lib/ansible/modules/extras | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py index 6a5f795064..ce8a9cc5af 100644 --- a/lib/ansible/module_utils/facts.py +++ b/lib/ansible/module_utils/facts.py @@ -241,6 +241,10 @@ class Facts(object): self.facts['architecture'] = data[0] elif self.facts['system'] == 'OpenBSD': self.facts['architecture'] = platform.uname()[5] + machine_id = get_file_content("/var/lib/dbus/machine-id") or get_file_content("/etc/machine-id") + if machine_id: + machine_id = machine_id.split('\n')[0] + self.facts["machine_id"] = machine_id def get_local_facts(self): @@ -702,10 +706,6 @@ class Distribution(object): except AttributeError: pass - machine_id = get_file_content("/var/lib/dbus/machine-id") or get_file_content("/etc/machine-id") - if machine_id: - machine_id = machine_id.split('\n')[0] - self.facts["machine_id"] = machine_id self.facts['os_family'] = self.facts['distribution'] distro = self.facts['distribution'].replace(' ', '_') if distro in self.OS_FAMILY: diff --git a/lib/ansible/modules/core b/lib/ansible/modules/core index 9eb2b557cd..4549ea5e85 160000 --- a/lib/ansible/modules/core +++ b/lib/ansible/modules/core @@ -1 +1 @@ -Subproject commit 9eb2b557cd08f2a6d381ec0360fa47750146b65a +Subproject commit 4549ea5e8550217412e032ed0340e9d4a0b38923 diff --git a/lib/ansible/modules/extras b/lib/ansible/modules/extras index d9caac037c..86f08bfcda 160000 --- a/lib/ansible/modules/extras +++ b/lib/ansible/modules/extras @@ -1 +1 @@ -Subproject commit d9caac037cf10f0abaeff1430605387ab011d54f +Subproject commit 86f08bfcda17e95fb284f9a8b7c0a3cbf518173b