b5efb1efc7465a75b270a6325ed0d008db4007e0
[doctor.git] / doctor_tests / installer / common / restore_congress.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
13 def restore_drivers_config():
14     co_conf = "/etc/congress/congress.conf"
15     co_conf_bak = "/etc/congress/congress.conf.bak"
16
17     if not os.path.isfile(co_conf_bak):
18         print('Bak_file:%s does not exist.' % co_conf_bak)
19     else:
20         print('restore: %s' % co_conf)
21         shutil.copyfile(co_conf_bak, co_conf)
22         os.remove(co_conf_bak)
23     return
24
25
26 restore_drivers_config()