swift-upgrade revision 4070
4070N/A# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. 4070N/A# Licensed under the Apache License, Version 2.0 (the "License"); you may 4070N/A# not use this file except in compliance with the License. You may obtain 4070N/A# Unless required by applicable law or agreed to in writing, software 4070N/A# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 4070N/A# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 4070N/A# License for the specific language governing permissions and limitations 4070N/A """ Copy over all uncommented options from the old configuration file. 4070N/A # open the previous version 4070N/A # The upgrade did not deliver a .new file so, return 4070N/A # walk every single section for uncommented options 4070N/A # DEFAULT items show up in every section so remove them 4070N/A # keep a copy of the old value 4070N/A print "Changing [%s] %s:\n- %s\n+ %s" % \
4070N/A # the new configuration file does not have this option set so 4070N/A # Only copy the old value to the new conf file if the entry doesn't 4070N/A # exist or if it contains '%SERVICE' 4070N/A # copy the old conf file to a backup 4070N/A # copy the new conf file in place 4070N/A # extract the openstack-upgrade-id from the pkg 4070N/A # the versions are different, so perform an upgrade 4070N/A # modify the configuration files 4070N/A # update the current version