keystone-upgrade revision 4070
943N/A# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. 561N/A# Licensed under the Apache License, Version 2.0 (the "License"); you may 919N/A# not use this file except in compliance with the License. You may obtain 919N/A# a copy of the License at 919N/A# Unless required by applicable law or agreed to in writing, software 919N/A# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 919N/A# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 919N/A# License for the specific language governing permissions and limitations 970N/A ('DEFAULT', 'rabbit_durable_queues'): ('DEFAULT', 'amqp_durable_queues'), 970N/A ('rpc_notifier2', 'topics'): ('DEFAULT', 'notification_topics'), 561N/A ('DEFAULT', 'log_config'): ('DEFAULT', 'log_config_append'), 837N/A ('DEFAULT', 'logfile'): ('DEFAULT', 'log_file'), 561N/A ('DEFAULT', 'logdir'): ('DEFAULT', 'log_dir'), 911N/A ('DEFAULT', 'db_backend'): ('database', 'backend'), 911N/A ('DEFAULT', 'sql_connection'): ('database', 'connection'), 911N/A ('DATABASE', 'sql_connection'): ('database', 'connection'), 911N/A ('sql', 'connection'): ('database', 'connection'), 561N/A ('DEFAULT', 'sql_idle_timeout'): ('database', 'idle_timeout'), 561N/A ('DATABASE', 'sql_idle_timeout'): ('database', 'idle_timeout'), ('sql', 'idle_timeout'): ('database', 'idle_timeout'), ('DEFAULT', 'sql_min_pool_size'): ('database', 'min_pool_size'), ('DATABASE', 'sql_min_pool_size'): ('database', 'min_pool_size'), ('DEFAULT', 'sql_max_pool_size'): ('database', 'max_pool_size'), ('DATABASE', 'sql_max_pool_size'): ('database', 'max_pool_size'), ('DEFAULT', 'sql_max_retries'): ('database', 'max_retries'), ('DATABASE', 'sql_max_retries'): ('database', 'max_retries'), ('DEFAULT', 'sql_retry_interval'): ('database', 'retry_interval'), ('DATABASE', 'reconnect_interval'): ('database', 'retry_interval'), ('DEFAULT', 'sql_max_overflow'): ('database', 'max_overflow'), ('DATABASE', 'sqlalchemy_max_overflow'): ('database', 'max_overflow'), ('DEFAULT', 'sql_connection_debug'): ('database', 'connection_debug'), ('DEFAULT', 'sql_connection_trace'): ('database', 'connection_trace'), ('DATABASE', 'sqlalchemy_pool_timeout'): ('database', 'pool_timeout'), ('ldap', 'tenant_tree_dn'): ('ldap', 'project_tree_dn'), ('ldap', 'tenant_filter'): ('ldap', 'project_filter'), ('ldap', 'tenant_objectclass'): ('ldap', 'project_objectclass'), ('ldap', 'tenant_id_attribute'): ('ldap', 'project_id_attribute'), ('ldap', 'tenant_member_attribute'): ('ldap', 'project_member_attribute'), ('ldap', 'tenant_name_attribute'): ('ldap', 'project_name_attribute'), ('ldap', 'tenant_desc_attribute'): ('ldap', 'project_desc_attribute'), ('ldap', 'tenant_enabled_attribute'): ('ldap', 'project_enabled_attribute'), ('ldap', 'tenant_domain_id_attribute'): ('ldap', 'project_domain_id_attribute'), ('ldap', 'tenant_attribute_ignore'): ('ldap', 'project_attribute_ignore'), ('ldap', 'tenant_allow_create'): ('ldap', 'project_allow_create'), ('ldap', 'tenant_allow_update'): ('ldap', 'project_allow_update'), ('ldap', 'tenant_allow_delete'): ('ldap', 'project_allow_delete'), ('ldap', 'tenant_enabled_emulation'): ('ldap', 'project_enabled_emulation'), ('ldap', 'tenant_enabled_emulation_dn'): ('ldap', 'project_enabled_emulation_dn'), ('ldap', 'tenant_additional_attribute_mapping'): ('ldap', 'project_additional_attribute_mapping'), ('DEFAULT', 'matchmaker_ringfile'): ('matchmaker_ring', 'ringfile'), """ look for deprecated variables and, if found, convert it to the new print "Deprecated value found: [%s] %s" %
(section, key) print "Removing from configuration" """ Convert MySQL tables to use utf8 # mysql is not ready. sleep for 2 more seconds print "Unable to connect to MySQL: %s" %
err print ("Please verify MySQL is properly configured and online " "before using svcadm(1M) to clear this service.") "CHARACTER SET 'utf8', COLLATE 'utf8_general_ci'" """ Copy over all uncommented options from the old configuration file. In addition, look for deprecated section/keys and convert them to the new # open the previous version # The upgrade did not deliver a .new file so, return # walk every single section for uncommented options # DEFAULT items show up in every section so remove them # keep a copy of the old value # option is deprecated so continue # print to the log when a value for the same section.key is # changing to a new value print "Changing [%s] %s:\n- %s\n+ %s" % \
# the new configuration file does not have this option set so # 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 # extract the openstack-upgrade-id from the pkg p =
Popen(['/usr/bin/pkg', 'contents', '-H', '-t', 'set', '-o', 'value', # look for any .new files # the versions are different, so perform an upgrade # modify the configuration files # In certain cases the database section does not exist and the # default database chosen is sqlite. print "altered character set to utf8 in keystone tables" # update the current version print 'Unknown error: %s' %
err