swift-upgrade revision 4049
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import glob
""" Copy over all uncommented options from the old configuration file.
"""
# open the previous version
# open the new version
try:
if err.errno == errno.ENOENT:
# The upgrade did not deliver a .new file so, return
return
else:
print "\nupdating %s" % old_file
# walk every single section for uncommented options
# DEFAULT items show up in every section so remove them
if section != 'DEFAULT':
else:
# keep a copy of the old value
if section != 'DEFAULT':
# print to the log when a value for the same section.key is
# changing to a new value
try:
print "Changing [%s] %s:\n- %s\n+ %s" % \
print
# the new configuration file does not have this option set so
# just continue
# Only copy the old value to the new conf file if the entry doesn't
# exist or if it contains '%SERVICE'
# copy the old conf file to a backup
# copy the new conf file in place
# pull out the current version of config/upgrade-id
# extract the openstack-upgrade-id from the pkg
# No need to upgrade
# look for any .new files
# the versions are different, so perform an upgrade
# modify the configuration files
# update the current version
if __name__ == '__main__':
try:
print 'Unknown error: %s' % err
print