1 ##############################################################################
2 # Copyright (c) 2017 ZTE Corporation and others.
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 ##############################################################################
13 def restore_drivers_config():
14 co_base = "/var/lib/config-data/puppet-generated/congress"
15 if not os.path.isdir(co_base):
17 co_conf = co_base + "/etc/congress/congress.conf"
18 co_conf_bak = co_base + "/etc/congress/congress.conf.bak"
20 if not os.path.isfile(co_conf_bak):
21 print('Bak_file:%s does not exist.' % co_conf_bak)
23 print('restore: %s' % co_conf)
24 shutil.copyfile(co_conf_bak, co_conf)
25 os.remove(co_conf_bak)
29 restore_drivers_config()