diff options
author | Tomi Juvonen <tomi.juvonen@nokia.com> | 2018-09-28 12:15:43 +0300 |
---|---|---|
committer | Tomi Juvonen <tomi.juvonen@nokia.com> | 2018-10-29 12:52:57 +0000 |
commit | 9e012b87f560fe13f8cc63a21321a4f0c2efa1b0 (patch) | |
tree | 5f70c3f4309d13a9fc217e404e2680ac847220cb /doctor_tests/installer/common/restore_aodh.py | |
parent | a7517dda9ede8bedadcbcedf7a46187268977d3a (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>
(cherry picked from commit a6575910a137f8932e294f66c9da3194ad937691)
Diffstat (limited to 'doctor_tests/installer/common/restore_aodh.py')
-rw-r--r-- | doctor_tests/installer/common/restore_aodh.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/doctor_tests/installer/common/restore_aodh.py b/doctor_tests/installer/common/restore_aodh.py new file mode 100644 index 00000000..b55eae8d --- /dev/null +++ b/doctor_tests/installer/common/restore_aodh.py @@ -0,0 +1,32 @@ +############################################################################## +# Copyright (c) 2018 Nokia Corporation and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +import os +import subprocess + + +def restore_aodh_event_alarm(): + # Remove modified docker and restore original + orig = "orig_docker_id" + new = "new_docker_id" + if os.path.isfile(orig): + with open("orig_docker_id", 'r') as oid: + orig_docker_id = oid.read() + oid.close() + if os.path.isfile(new): + with open("new_docker_id", 'r') as nid: + new_docker_id = nid.read() + nid.close() + subprocess.check_output("docker stop %s" % new_docker_id, + shell=True) + subprocess.check_output("docker rm %s" % new_docker_id, shell=True) + os.remove(new) + subprocess.check_output("docker start %s" % orig_docker_id, shell=True) + os.remove(orig) + +restore_aodh_event_alarm() |