diff options
author | Tomi Juvonen <tomi.juvonen@nokia.com> | 2018-01-17 10:20:44 +0200 |
---|---|---|
committer | Tomi Juvonen <tomi.juvonen@nokia.com> | 2018-08-09 12:08:49 +0300 |
commit | b54cbc5dd2d32fcb27238680b4657ed384d021c5 (patch) | |
tree | 4a7e648892d8d1c0efe50e276452a45c754303fb /doctor_tests/installer/common/restore_compute_config.py | |
parent | b2bb504032ac81a2ed3f404113b097d9ce3d7f14 (diff) |
Add setup and cleanup for maintenance test
JIRA: DOCTOR-106
Change-Id: Idb95e1391e8f9094f68e2c7bc79fd2d7e01af9de
Signed-off-by: Tomi Juvonen <tomi.juvonen@nokia.com>
Diffstat (limited to 'doctor_tests/installer/common/restore_compute_config.py')
-rw-r--r-- | doctor_tests/installer/common/restore_compute_config.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/doctor_tests/installer/common/restore_compute_config.py b/doctor_tests/installer/common/restore_compute_config.py new file mode 100644 index 00000000..0971d12b --- /dev/null +++ b/doctor_tests/installer/common/restore_compute_config.py @@ -0,0 +1,25 @@ +############################################################################## +# 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 shutil + + +def restore_cpu_allocation_ratio(): + nova_file = '/etc/nova/nova.conf' + nova_file_bak = '/etc/nova/nova.bak' + + if not os.path.isfile(nova_file_bak): + print('Bak_file:%s does not exist.' % nova_file_bak) + else: + print('restore: %s' % nova_file) + shutil.copyfile(nova_file_bak, nova_file) + os.remove(nova_file_bak) + return + +restore_cpu_allocation_ratio() |