summaryrefslogtreecommitdiffstats
path: root/doctor_tests/installer/common/set_compute_config.py
diff options
context:
space:
mode:
authorTomi Juvonen <tomi.juvonen@nokia.com>2018-09-28 12:15:43 +0300
committerTomi Juvonen <tomi.juvonen@nokia.com>2018-10-25 13:57:03 +0300
commita6575910a137f8932e294f66c9da3194ad937691 (patch)
treee11851ae691892fea7f0efb9922f115fbb0521a9 /doctor_tests/installer/common/set_compute_config.py
parent61eb3927ada784cc3dffb5ddd17f66e47871f708 (diff)
Support Apex with services in containers
Upstream apex now works in containers, so if used, it needs to be supported JIRA: DOCTOR-130 Change-Id: I3d73a1699e4fee53b001f043f55d0eeefa7bfb7b Signed-off-by: Tomi Juvonen <tomi.juvonen@nokia.com>
Diffstat (limited to 'doctor_tests/installer/common/set_compute_config.py')
-rw-r--r--doctor_tests/installer/common/set_compute_config.py21
1 files changed, 19 insertions, 2 deletions
diff --git a/doctor_tests/installer/common/set_compute_config.py b/doctor_tests/installer/common/set_compute_config.py
index 07db1e16..86266085 100644
--- a/doctor_tests/installer/common/set_compute_config.py
+++ b/doctor_tests/installer/common/set_compute_config.py
@@ -10,9 +10,26 @@ import os
import shutil
+def make_initial_config(service, dest):
+ for mk in ["", "/etc", "/%s" % service]:
+ dest += mk
+ os.mkdir(dest)
+ src = "/etc/%s/%s.conf" % (service, service)
+ dest += "/%s.conf" % service
+ shutil.copyfile(src, dest)
+
+
def set_cpu_allocation_ratio():
- nova_file = '/etc/nova/nova.conf'
- nova_file_bak = '/etc/nova/nova.bak'
+ docker_conf_base_dir = "/var/lib/config-data/puppet-generated"
+ if not os.path.isdir(docker_conf_base_dir):
+ nova_base = ""
+ else:
+ nova_base = "%s/nova" % docker_conf_base_dir
+ if not os.path.isdir(nova_base):
+ # nova.conf to be used might not exist
+ make_initial_config("nova", nova_base)
+ nova_file = nova_base + '/etc/nova/nova.conf'
+ nova_file_bak = nova_base + '/etc/nova/nova.bak'
if not os.path.isfile(nova_file):
raise Exception("File doesn't exist: %s." % nova_file)