This reverts commit e7782f85919bb0077d66cbe3a9fb1e0c1f961639.
Conflicts:
audrey_start/audrey_startup.in.py
---
audrey_start/Makefile | 2 +-
audrey_start/aeolus-audrey-agent.spec.in | 6 ++--
audrey_start/audrey_startup.in.py | 37 +++++++++++++++++++++++++++--
3 files changed, 38 insertions(+), 7 deletions(-)
diff --git a/audrey_start/Makefile b/audrey_start/Makefile
index e15580a..8cd1bf5 100644
--- a/audrey_start/Makefile
+++ b/audrey_start/Makefile
@@ -16,7 +16,7 @@
AUDREY_STARTUP_CACHE_DIR ?= $(HOME)/audrey-agent-cache
-VERSION = 0.4.1
+VERSION = 0.4.2
# For Release: 0..., set _audrey-agent_dev=1 so that we get extra_release.GIT-
# annotated rpm version strings.
diff --git a/audrey_start/aeolus-audrey-agent.spec.in
b/audrey_start/aeolus-audrey-agent.spec.in
index dd54ed3..a43d39d 100644
--- a/audrey_start/aeolus-audrey-agent.spec.in
+++ b/audrey_start/aeolus-audrey-agent.spec.in
@@ -15,7 +15,7 @@
#
Name: aeolus-audrey-agent
Version: @VERSION@
-Release: 1%{?dist}
+Release: 12%{?dist}
Summary: The Aeolus Audrey Startup Agent
Group: Applications/System
@@ -26,12 +26,12 @@ Source0:
http://joev.fedorapeople.org/audrey-agent/aeolus-audrey-agent-%{vers
# All of these are required for building since during the build
# process "audrey --help" is executed to generate the man page.
BuildRequires: help2man
-BuildRequires: python-phacter python-httplib2 python-oauth2
+BuildRequires: facter python-httplib2 python-oauth2
%if (0%{?fedora} <= 14 || 0%{?rhel} <= 6)
BuildRequires: python-argparse
%endif
-Requires: python-phacter python-httplib2 python-oauth2
+Requires: facter python-httplib2 python-oauth2
Requires: python-argparse
%if (0%{?fedora} <= 14 || 0%{?rhel} <= 6)
Requires: python-argparse
diff --git a/audrey_start/audrey_startup.in.py b/audrey_start/audrey_startup.in.py
index a92a719..eb9d26f 100755
--- a/audrey_start/audrey_startup.in.py
+++ b/audrey_start/audrey_startup.in.py
@@ -48,11 +48,10 @@ import os
import shutil
import sys
import tarfile
+import tarfile as tf # To simplify exception names.
import tempfile
import urllib
-import phacter
import oauth2 as oauth
-import tarfile as tf # To simplify exception names.
from time import sleep
from collections import deque
@@ -420,6 +419,36 @@ def parse_require_config(src):
return services
+def _get_system_info():
+ '''
+ Description:
+ Get the system info to be used for generating this instances
+ provides back to the Config Server.
+
+ Currently utilizes Puppet's facter via a Python subprocess call.
+
+ Input:
+ None
+
+ Returns:
+ A dictionary of system info name/value pairs.
+
+ '''
+
+ cmd = ['/usr/bin/facter']
+ ret = _run_cmd(cmd)
+ if ret['subproc'].returncode != 0:
+ _raise_ASError(('Failed command: \n%s \nError: \n%s') % \
+ (' '.join(cmd), str(ret['err'])))
+
+ facts = {}
+ for fact in ret['out'].split('\n'):
+ if fact: # Handle the new line at the end of the facter output
+ name, val = fact.split(' => ')
+ facts[ name ] = val.rstrip()
+
+ return facts
+
def parse_provides_params(src):
'''
Description:
@@ -493,10 +522,12 @@ def generate_provides(src):
provides_dict = {}
params_list = parse_provides_params(src)
+ system_info_dict = _get_system_info()
+
for param in params_list:
try:
provides_dict.update( \
- {param:base64.b64encode(phacter[param])})
+ {param:base64.b64encode(system_info_dict[param])})
except KeyError:
# A specified parameter is not found. Provide value ''
provides_dict.update({param:''})
--
1.7.7.3