Revert "Pretend mode for the Observer. With this option set, the Ansible recipes for operations are generated, but not executed."
Tabulation issues...
This reverts commit 1d019ae2fad410f6ac4e45d50e1c16fced30eb51.
diff --git a/xos/openstack_observer/ansible.py b/xos/openstack_observer/ansible.py
index e0754ea..f8ed547 100644
--- a/xos/openstack_observer/ansible.py
+++ b/xos/openstack_observer/ansible.py
@@ -62,31 +62,31 @@
os.system('mkdir -p %s'%'/'.join([sys_dir,path]))
fqp = '/'.join([sys_dir,path,objname])
+
f = open(fqp,'w')
f.write(buffer)
f.flush()
- if (not Config().observer_pretend):
- run = os.popen(XOS_DIR + '/observer/run_ansible %s'%shellquote(fqp))
- #run = os.popen('ansible-playbook -v %s'%shellquote(fqp))
- msg = run.read()
- status = run.close()
+ run = os.popen(XOS_DIR + '/observer/run_ansible %s'%shellquote(fqp))
+ #run = os.popen('ansible-playbook -v %s'%shellquote(fqp))
+ msg = run.read()
+ status = run.close()
+ try:
+ ok_results = parse_output(msg)
+ if (len(ok_results) != expected_num):
+ raise ValueError('Unexpected num')
+ except ValueError,e:
+ all_fatal = re.findall(r'^msg: (.*)',msg,re.MULTILINE)
+ all_fatal2 = re.findall(r'^ERROR: (.*)',msg,re.MULTILINE)
+
+
+ all_fatal.extend(all_fatal2)
try:
- ok_results = parse_output(msg)
- if (len(ok_results) != expected_num):
- raise ValueError('Unexpected num')
- except ValueError,e:
- all_fatal = re.findall(r'^msg: (.*)',msg,re.MULTILINE)
- all_fatal2 = re.findall(r'^ERROR: (.*)',msg,re.MULTILINE)
-
-
- all_fatal.extend(all_fatal2)
- try:
- error = ' // '.join(all_fatal)
- except:
- pass
- raise Exception(error)
+ error = ' // '.join(all_fatal)
+ except:
+ pass
+ raise Exception(error)
return ok_results
diff --git a/xos/xos_config b/xos/xos_config
index eaae50e..a618905 100644
--- a/xos/xos_config
+++ b/xos/xos_config
@@ -32,7 +32,6 @@
ca_ssl_cert=/etc/ssl/certs/ca-certificates.crt
[observer]
-pretend=False
backoff_disabled=False
images_directory=/opt/xos/images
dependency_graph=/opt/xos/model-deps