fix package path and move files under doctor_tests
[doctor.git] / doctor_tests / installer / common / restore_ceilometer.py
1 ##############################################################################
2 # Copyright (c) 2017 ZTE Corporation and others.
3 #
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9 import os
10 import shutil
11
12 ep_file = '/etc/ceilometer/event_pipeline.yaml'
13 ep_file_bak = '/etc/ceilometer/event_pipeline.yaml.bak'
14
15
16 def restore_ep_config():
17
18     if not os.path.isfile(ep_file_bak):
19         print('Bak_file:%s does not exist.' % ep_file_bak)
20     else:
21         print('restore')
22         shutil.copyfile(ep_file_bak, ep_file)
23         os.remove(ep_file_bak)
24     return
25
26
27 restore_ep_config()