summaryrefslogtreecommitdiffstats
path: root/doctor_tests/installer/local.py
diff options
context:
space:
mode:
authordongwenjuan <dong.wenjuan@zte.com.cn>2017-11-27 17:42:17 +0800
committerdongwenjuan <dong.wenjuan@zte.com.cn>2017-12-11 15:21:00 +0800
commit9e36d918fef054b8d23692c0ec8c25d7b0640c07 (patch)
tree11c25b259e8c53342153df2964aba76ce4d329ee /doctor_tests/installer/local.py
parentf71afa73f5a56474036215b598e45123578c38d9 (diff)
support vitrage inspector for local installer
JIRA: DOCTOR-122 Change-Id: I771f778767a204e809d892c70603e479c1ed2f5c Signed-off-by: dongwenjuan <dong.wenjuan@zte.com.cn>
Diffstat (limited to 'doctor_tests/installer/local.py')
-rw-r--r--doctor_tests/installer/local.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/doctor_tests/installer/local.py b/doctor_tests/installer/local.py
index 7d0ae542..453755c2 100644
--- a/doctor_tests/installer/local.py
+++ b/doctor_tests/installer/local.py
@@ -11,6 +11,8 @@ import shutil
import subprocess
from doctor_tests.installer.base import BaseInstaller
+from doctor_tests.installer.common.vitrage import set_vitrage_host_down_template
+from doctor_tests.common.constants import Inspector
from doctor_tests.common.utils import load_json_file
from doctor_tests.common.utils import write_json_file
@@ -43,13 +45,16 @@ class LocalInstaller(BaseInstaller):
cmd = "getent hosts %s | awk '{ print $1 }'" % (hostname)
server = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True)
stdout, stderr = server.communicate()
- host_ip = stdout.strip()
+ host_ip = stdout.strip().decode("utf-8")
self.log.info('Get host_ip:%s from host_name:%s in local installer' % (host_ip, hostname))
return host_ip
def set_apply_patches(self):
self._set_nova_policy()
+ if self.conf.inspector.type == Inspector.VITRAGE:
+ set_vitrage_host_down_template()
+ os.system('sudo systemctl restart devstack@vitrage-graph.service')
def restore_apply_patches(self):
self._restore_nova_policy()
@@ -94,7 +99,7 @@ class LocalInstaller(BaseInstaller):
if self.policy_modified or self.add_policy_file:
write_json_file(self.nova_policy_file, data)
- os.system('screen -S stack -p n-api -X stuff "^C^M^[[A^M"')
+ os.system('sudo systemctl restart devstack@n-api.service')
def _restore_nova_policy(self):
if self.policy_modified:
@@ -104,6 +109,6 @@ class LocalInstaller(BaseInstaller):
os.remove(self.nova_policy_file)
if self.add_policy_file or self.policy_modified:
- os.system('screen -S stack -p n-api -X stuff "^C^M^[[A^M"')
+ os.system('sudo systemctl restart devstack@n-api.service')
self.add_policy_file = False
self.policy_modified = False