components/openstack/keystone/files/keystone-upgrade
author Devjani Ray <devjani.ray@oracle.com>
Fri, 20 May 2016 17:42:29 -0400
branchs11u3-sru
changeset 6035 c9748fcc32de
parent 4625 18adb92d4193
permissions -rw-r--r--
PSARC 2015/535 OpenStack service updates for Kilo PSARC 2015/458 aioeventlet - asyncio event loop scheduling callbacks in eventlet PSARC 2015/460 msgpack - C/Python bindings for MessagePack (de)serializer data PSARC 2015/466 openstackclient - OpenStack Command-line Client PSARC 2015/467 oslo.versionedobjects - Oslo Versioned Objects library PSARC 2015/468 pint - A physical quantities module PSARC 2015/469 pysaml2 - A pure Python implementation of SAML2 PSARC 2015/471 semantic_version - A library implementing the 'SemVer' scheme PSARC 2015/472 testresources - PyUnit extension for managing expensive test resources PSARC 2015/473 testscenarios - Extensions to Python unittest to support scenarios PSARC 2015/474 trollius - Port of the Tulip project (asyncio module, PEP 3156) on Python 2 PSARC 2015/475 urllib3 - HTTP library with thread-safe connection pooling, file post, and more PSARC 2015/520 oslo.concurrency - Oslo Concurrency library PSARC 2015/521 oslo.log - Oslo Logging Configuration library PSARC 2015/529 oslo.policy - Oslo Policy library PSARC 2015/530 psutil - Python system and process utilities PSARC 2015/538 fixtures - Python module to support reusable state for writing clean tests PSARC 2015/539 sqlparse - An SQL parser module for Python PSARC 2016/017 extras - Useful extra utilities for Python PSARC 2016/018 linecache2 - Port of the standard linecache module PSARC 2016/019 python-mimeparse - Basic functions for parsing mime-types PSARC 2016/020 testtools - Extensions to the Python unit testing framework PSARC 2016/021 traceback2 - Port of the standard traceback module PSARC 2016/014 OpenStack Cinder NFS driver for Solaris PSARC/2016/010 cloudbase-init: Portable cloud image initialization PSARC/2016/130 Solaris OpenStack Puppet Extensions PSARC/2016/172 Making OpenStack Nova's image cache sharable PSARC/2016/001 OpenStack Puppet Modules PSARC/2016/016 Rename/Refactor Puppet and Puppet Module Packages PSARC/2015/368 Common Puppet Modules PSARC 2015/357 OpenStack Nova support for kernel zone suspend/resume 22384068 OpenStack service updates for Kilo (Umbrella) 23205460 Fix for 23192887 breaks Juno to Kilo upgrade with instances and floating IPs 23192887 Upgrade from Juno to Kilo fails (neutron-upgrade) due to typo 22878181 Neutron database tables not upgraded properly from Juno to Kilo schema 22935140 Kilo upgrade adds deprecated settings for rabbit and qpid 22935039 Kilo upgrade conf file migration errors 23027746 Metadata access broken with too many networks 23040216 extra zfssa_ prefix in the zfssa_iscsi.pp backend manifest 22992961 Update saz-memcached to 2.8.1 22992956 Update puppetlabs-stdlib to 4.11.0 22992951 Update puppetlabs-ntp to 4.1.2 22992946 Update puppetlabs-mysql to 3.6.2 22992926 Update puppetlabs-apache to 1.8.1 22992933 Update puppetlabs-inifile to 1.4.3 22999085 apache puppet module doesn't support ssl on Solaris 22985076 neutron_network provider always sets --shared on new networks 22813139 add zfssa cinder puppet modules 22902222 add NFS cinder puppet modules 22918553 update vpnaas and l3 agent puppet modules 22902853 Neutron/VPNaaS needs a workaround for 22902761 22827759 nova-compute still trips over itself when rad:local restarts 20990774 nova image cache bloats clone archives to godzilla size 22750945 Revert resize same host branded zones results in error status 18733958 nova tried to create x86 instance on SPARC 22220227 failure to apply zonecfg in attach_volume can leave debris in zonecfg 22935198 puppetlabs-mysql should define basedir in params.pp 22911268 Update puppetlabs-rabbitmq to 5.3.1 22852949 problem in PYTHON-MOD/DJANGO 22852962 problem in PYTHON-MOD/DJANGO 22819808 target_provision_state should not be set to AVAILABLE 22491714 Request to integrate OpenStack Puppet modules 22713569 nova-conductor doesn't handle RPC timeout during live-migration well 22695176 Miscellaneous package cleanup for Kilo 22694904 Some of the OpenStack patches can be cleaned up 22694680 Dependencies in several OpenStack service packages can be improved 22694592 Several configuration files should be more aligned with the upstream 22575858 problem in SERVICE/SWIFT 22047789 puppet package name and dependencies are confusing 22664785 Puppet module files should be owned by puppet 21460057 Add cloudbase-init to Solaris 21974208 The Python module msgpack should be added to Userland 22010630 The Python trollius module should be added to Userland 22011755 The Python module pint should be added to Userland 22012256 The Python aioeventlet module should be added to Userland 22012282 The Python oslo.versionedobjects module should be added to Userland 22012317 The Python semantic_version module should be added to Userland 22012321 The Python testresources module should be added to Userland 22012329 The Python testscenarios module should be added to Userland 22012336 The Python urllib3 module should be added to Userland 22012343 The Python openstackclient module should be added to Userland 22299389 The Python oslo.concurrency module should be added to Userland 22299409 The Python oslo.log module should be added to Userland 22299418 The Python oslo.policy module should be added to Userland 22299469 The Python psutil module should be added to Userland 22337793 The Python sqlparse module should be added to Userland 22338325 The Python fixtures module should be added to Userland 22535728 The Python testtools module should be added to Userland 22535739 The Python extras module should be added to Userland 22535748 The Python linecache2 module should be added to Userland 22535753 The Python traceback2 module should be added to Userland 22535760 The Python python-mimeparse module should be added to Userland 18961001 Image filtering does not function as expected 21678935 NFS for Cinder in Solaris OpenStack 22548630 derived manifest should not enforce presence of global when installing from UAR 22629795 problem in SERVICE/KEYSTONE 22151922 zones_suspend_path needs update based on post-PSARC discussion 21660603 passlib dependency needs to be added to Nova 22188197 puppetlabs-rabbitmq needs a patch to handle rabbitmqadmin 21756542 problem in SERVICE/SWIFT 21978756 addrconf addresses must be created for stateless and slaac Neutron subnets 21978743 ndpd.conf entries are incorrectly formatted for IPv6 subnets 21919000 neutron-dhcp-agent and neutron-server have timing issues 21918991 database times out when attempting various actions 21682493 Neutron fails due to mysql transaction locks when creating multiple instances 22024767 Remove annoying "Arguments dropped when creating context" logging 21691386 Request to integrate common puppet modules into Userland 21630128 Neutron needs to support updating subnet DNS configuration 21761279 Driver erroneously includes trailing space in zone.install() arguments 21438537 After update, openstack/keystone/keystone-token-flush not running 21630538 Nova driver should support suspend/resume 21542088 VM's display_name is used instead of hostname to set the hostname for VM 19774239 Nova should support setting the Admin Password 21439855 Console SMF instance remains after nova instance is deleted 21348400 Issues encountered via unit testing 21341088 Parsing manifest/profiles fails if multiple criteria present 21303465 edit image window has no ZFS disk format option 21091598 ceilometerclient's Makefile needs to point to its own PROJECT_URL 21164329 saharaclient COMPONENT_BUGDB points to the wrong subcomponent 20431382 keystone should include a periodic token cleanup job 21299660 enable no-gateway check box now that we support it 21135855 Enable gateway-less external networks 20230409 remove _get_zone_auto_install_state from driver.py 21022556 optional dependencies on rabbitmq need work in OpenStack services 22568587 heat denial of service through template-validate 22157556 RabbitMQ Warning: Mochiweb enabled and Erlang version 17
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4625
18adb92d4193 20816335 move the core OpenStack components to Python 2.7
Drew Fisher <drew.fisher@oracle.com>
parents: 4314
diff changeset
     1
#!/usr/bin/python2.7
4072
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
     2
6035
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
     3
# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
4072
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
     4
#
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
     5
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
     6
#    not use this file except in compliance with the License. You may obtain
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
     7
#    a copy of the License at
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
     8
#
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
     9
#         http://www.apache.org/licenses/LICENSE-2.0
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    10
#
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    11
#    Unless required by applicable law or agreed to in writing, software
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    12
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    13
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    14
#    License for the specific language governing permissions and limitations
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    15
#    under the License.
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    16
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    17
import glob
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    18
import os
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    19
from subprocess import check_call, Popen, PIPE
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    20
import sys
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    21
import traceback
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    22
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    23
import iniparse
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    24
import smf_include
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    25
import sqlalchemy
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    26
4314
96c1b7e2e45c PSARC/2015/233 OpenStack Common Package
Drew Fisher <drew.fisher@oracle.com>
parents: 4207
diff changeset
    27
from openstack_common import alter_mysql_tables, create_backups, modify_conf
96c1b7e2e45c PSARC/2015/233 OpenStack Common Package
Drew Fisher <drew.fisher@oracle.com>
parents: 4207
diff changeset
    28
4072
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    29
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    30
KEYSTONE_CONF_MAPPINGS = {
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    31
    # Deprecated group/name
6035
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    32
    ('DEFAULT', 'admin_bind_host'): ('eventlet_server', 'admin_bind_host'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    33
    ('DEFAULT', 'admin_workers'): ('eventlet_server', 'admin_workers'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    34
    ('DEFAULT', 'admin_port'): ('eventlet_server', 'admin_port'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    35
    ('DEFAULT', 'tcp_keepidle'): ('eventlet_server', 'tcp_keepidle'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    36
    ('ssl', 'cert_required'): ('eventlet_server_ssl', 'cert_required'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    37
    ('DEFAULT', 'public_port'): ('eventlet_server', 'public_port'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    38
    ('DEFAULT', 'public_bind_host'): ('eventlet_server', 'public_bind_host'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    39
    ('DEFAULT', 'tcp_keepalive'): ('eventlet_server', 'tcp_keepalive'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    40
    ('DEFAULT', 'public_workers'): ('eventlet_server', 'public_workers'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    41
    ('ssl', 'keyfile'): ('eventlet_server_ssl', 'keyfile'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    42
    ('ssl', 'ca_certs'): ('eventlet_server_ssl', 'ca_certs'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    43
    ('ssl', 'enable'): ('eventlet_server_ssl', 'enable'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    44
    ('ssl', 'certfile'): ('eventlet_server_ssl', 'certfile'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    45
    ('DEFAULT', 'amqp_durable_queues'):
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    46
        ('oslo_messaging_qpid', 'amqp_durable_queues'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    47
    ('DEFAULT', 'amqp_auto_delete'):
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    48
        ('oslo_messaging_qpid', 'amqp_auto_delete'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    49
    ('DEFAULT', 'rpc_conn_pool_size'):
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    50
        ('oslo_messaging_qpid', 'rpc_conn_pool_size'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    51
    ('DEFAULT', 'qpid_hostname'):
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    52
        ('oslo_messaging_qpid', 'qpid_hostname'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    53
    ('DEFAULT', 'qpid_port'):
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    54
        ('oslo_messaging_qpid', 'qpid_port'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    55
    ('DEFAULT', 'qpid_hosts'):
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    56
        ('oslo_messaging_qpid', 'qpid_hosts'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    57
    ('DEFAULT', 'qpid_username'):
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    58
        ('oslo_messaging_qpid', 'qpid_username'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    59
    ('DEFAULT', 'qpid_password'):
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    60
        ('oslo_messaging_qpid', 'qpid_password'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    61
    ('DEFAULT', 'qpid_sasl_mechanisms'):
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    62
        ('oslo_messaging_qpid', 'qpid_sasl_mechanisms'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    63
    ('DEFAULT', 'qpid_heartbeat'):
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    64
        ('oslo_messaging_qpid', 'qpid_heartbeat'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    65
    ('DEFAULT', 'qpid_tcp_nodelay'):
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    66
        ('oslo_messaging_qpid', 'qpid_tcp_nodelay'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    67
    ('DEFAULT', 'qpid_receiver_capacity'):
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    68
        ('oslo_messaging_qpid', 'qpid_receiver_capacity'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    69
    ('DEFAULT', 'qpid_topology_version'):
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    70
        ('oslo_messaging_qpid', 'qpid_topology_version'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    71
    ('DEFAULT', 'kombu_ssl_version'):
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    72
        ('oslo_messaging_rabbit', 'kombu_ssl_version'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    73
    ('DEFAULT', 'kombu_ssl_keyfile'):
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    74
        ('oslo_messaging_rabbit', 'kombu_ssl_keyfile'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    75
    ('DEFAULT', 'kombu_ssl_certfile'):
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    76
        ('oslo_messaging_rabbit', 'kombu_ssl_certfile'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    77
    ('DEFAULT', 'kombu_ssl_ca_certs'):
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    78
        ('oslo_messaging_rabbit', 'kombu_ssl_ca_certs'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    79
    ('DEFAULT', 'kombu_reconnect_delay'):
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    80
        ('oslo_messaging_rabbit', 'kombu_reconnect_delay'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    81
    ('DEFAULT', 'rabbit_host'):
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    82
        ('oslo_messaging_rabbit', 'rabbit_host'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    83
    ('DEFAULT', 'rabbit_port'):
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    84
        ('oslo_messaging_rabbit', 'rabbit_port'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    85
    ('DEFAULT', 'rabbit_hosts'):
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    86
        ('oslo_messaging_rabbit', 'rabbit_hosts'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    87
    ('DEFAULT', 'rabbit_use_ssl'):
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    88
        ('oslo_messaging_rabbit', 'rabbit_use_ssl'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    89
    ('DEFAULT', 'rabbit_userid'):
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    90
        ('oslo_messaging_rabbit', 'rabbit_userid'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    91
    ('DEFAULT', 'rabbit_password'):
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    92
        ('oslo_messaging_rabbit', 'rabbit_password'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    93
    ('DEFAULT', 'rabbit_login_method'):
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    94
        ('oslo_messaging_rabbit', 'rabbit_login_method'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    95
    ('DEFAULT', 'rabbit_virtual_host'):
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    96
        ('oslo_messaging_rabbit', 'rabbit_virtual_host'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    97
    ('DEFAULT', 'rabbit_retry_interval'):
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    98
        ('oslo_messaging_rabbit', 'rabbit_retry_interval'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
    99
    ('DEFAULT', 'rabbit_retry_backoff'):
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
   100
        ('oslo_messaging_rabbit', 'rabbit_retry_backoff'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
   101
    ('DEFAULT', 'rabbit_max_retries'):
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
   102
        ('oslo_messaging_rabbit', 'rabbit_max_retries'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
   103
    ('DEFAULT', 'rabbit_ha_queues'):
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
   104
        ('oslo_messaging_rabbit', 'rabbit_ha_queues'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
   105
    ('DEFAULT', 'fake_rabbit'):
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
   106
        ('oslo_messaging_rabbit', 'fake_rabbit'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
   107
    ('DEFAULT', 'max_request_body_size'):
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
   108
        ('oslo_middleware', 'max_request_body_size'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
   109
    ('assignment', 'list_limit'): ('resource', 'list_limit'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
   110
    ('assignment', 'caching'): ('resource', 'caching'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
   111
    ('assignment', 'cache_time'): ('resource', 'cache_time'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
   112
    ('token', 'revocation_cache_time'): ('revoke', 'cache_time'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
   113
    ('DEFAULT', 'log-format'): (None, None),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
   114
    ('DEFAULT', 'use-syslog'): (None, None),
4072
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   115
}
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   116
4314
96c1b7e2e45c PSARC/2015/233 OpenStack Common Package
Drew Fisher <drew.fisher@oracle.com>
parents: 4207
diff changeset
   117
KEYSTONE_CONF_EXCEPTIONS = [
6035
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
   118
    ('eventlet_server', 'public_workers'),
c9748fcc32de PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents: 4625
diff changeset
   119
    ('eventlet_server', 'admin_workers'),
4314
96c1b7e2e45c PSARC/2015/233 OpenStack Common Package
Drew Fisher <drew.fisher@oracle.com>
parents: 4207
diff changeset
   120
    ('database', 'connection'),
96c1b7e2e45c PSARC/2015/233 OpenStack Common Package
Drew Fisher <drew.fisher@oracle.com>
parents: 4207
diff changeset
   121
]
4072
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   122
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   123
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   124
def start():
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   125
    # pull out the current version of config/upgrade-id
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   126
    p = Popen(['/usr/bin/svcprop', '-p', 'config/upgrade-id',
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   127
               os.environ['SMF_FMRI']], stdout=PIPE, stderr=PIPE)
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   128
    curr_ver, _err = p.communicate()
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   129
    curr_ver = curr_ver.strip()
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   130
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   131
    # extract the openstack-upgrade-id from the pkg
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   132
    p = Popen(['/usr/bin/pkg', 'contents', '-H', '-t', 'set', '-o', 'value',
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   133
               '-a', 'name=openstack.upgrade-id',
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   134
               'pkg:/cloud/openstack/keystone'], stdout=PIPE, stderr=PIPE)
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   135
    pkg_ver, _err = p.communicate()
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   136
    pkg_ver = pkg_ver.strip()
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   137
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   138
    if curr_ver == pkg_ver:
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   139
        # No need to upgrade
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   140
        sys.exit(smf_include.SMF_EXIT_OK)
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   141
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   142
    # look for any .new files
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   143
    if glob.glob('/etc/keystone/*.new'):
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   144
        # the versions are different, so perform an upgrade
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   145
        # modify the configuration files
4314
96c1b7e2e45c PSARC/2015/233 OpenStack Common Package
Drew Fisher <drew.fisher@oracle.com>
parents: 4207
diff changeset
   146
96c1b7e2e45c PSARC/2015/233 OpenStack Common Package
Drew Fisher <drew.fisher@oracle.com>
parents: 4207
diff changeset
   147
        # backup all the old configuration files
96c1b7e2e45c PSARC/2015/233 OpenStack Common Package
Drew Fisher <drew.fisher@oracle.com>
parents: 4207
diff changeset
   148
        create_backups('/etc/keystone')
96c1b7e2e45c PSARC/2015/233 OpenStack Common Package
Drew Fisher <drew.fisher@oracle.com>
parents: 4207
diff changeset
   149
96c1b7e2e45c PSARC/2015/233 OpenStack Common Package
Drew Fisher <drew.fisher@oracle.com>
parents: 4207
diff changeset
   150
        modify_conf('/etc/keystone/keystone.conf', KEYSTONE_CONF_MAPPINGS,
96c1b7e2e45c PSARC/2015/233 OpenStack Common Package
Drew Fisher <drew.fisher@oracle.com>
parents: 4207
diff changeset
   151
                    KEYSTONE_CONF_EXCEPTIONS)
4072
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   152
        modify_conf('/etc/keystone/keystone-paste.ini')
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   153
        modify_conf('/etc/keystone/logging.conf')
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   154
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   155
    config = iniparse.RawConfigParser()
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   156
    config.read('/etc/keystone/keystone.conf')
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   157
    # In certain cases the database section does not exist and the
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   158
    # default database chosen is sqlite.
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   159
    if config.has_section('database'):
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   160
        db_connection = config.get('database', 'connection')
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   161
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   162
        if db_connection.startswith('mysql'):
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   163
            engine = sqlalchemy.create_engine(db_connection)
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   164
            if engine.url.username != '%SERVICE_USER%':
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   165
                alter_mysql_tables(engine)
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   166
                print "altered character set to utf8 in keystone tables"
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   167
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   168
    # update the current version
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   169
    check_call(['/usr/sbin/svccfg', '-s', os.environ['SMF_FMRI'], 'setprop',
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   170
               'config/upgrade-id', '=', pkg_ver])
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   171
    check_call(['/usr/sbin/svccfg', '-s', os.environ['SMF_FMRI'], 'refresh'])
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   172
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   173
    sys.exit(smf_include.SMF_EXIT_OK)
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   174
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   175
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   176
if __name__ == '__main__':
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   177
    os.putenv('LC_ALL', 'C')
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   178
    try:
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   179
        smf_include.smf_main()
4314
96c1b7e2e45c PSARC/2015/233 OpenStack Common Package
Drew Fisher <drew.fisher@oracle.com>
parents: 4207
diff changeset
   180
    except RuntimeError:
96c1b7e2e45c PSARC/2015/233 OpenStack Common Package
Drew Fisher <drew.fisher@oracle.com>
parents: 4207
diff changeset
   181
        sys.exit(smf_include.SMF_EXIT_ERR_FATAL)
4072
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   182
    except Exception as err:
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   183
        print 'Unknown error:  %s' % err
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   184
        print
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   185
        traceback.print_exc(file=sys.stdout)
db0cec748ec0 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
   186
        sys.exit(smf_include.SMF_EXIT_ERR_FATAL)