Revert revno: 92
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
#branch: lp:charm-helpers
|
branch: lp:charm-helpers
|
||||||
branch: /home/ubuntu/smack-stack/trusty/charm-helpers
|
|
||||||
destination: hooks/charmhelpers
|
destination: hooks/charmhelpers
|
||||||
include:
|
include:
|
||||||
- core
|
- core
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#branch: lp:charm-helpers
|
branch: lp:charm-helpers
|
||||||
branch: /home/ubuntu/smack-stack/trusty/charm-helpers
|
|
||||||
destination: tests/charmhelpers
|
destination: tests/charmhelpers
|
||||||
include:
|
include:
|
||||||
- contrib.amulet
|
- contrib.amulet
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ from charmhelpers.contrib.openstack.utils import (
|
|||||||
configure_installation_source,
|
configure_installation_source,
|
||||||
error_out,
|
error_out,
|
||||||
get_os_codename_install_source,
|
get_os_codename_install_source,
|
||||||
git_insert_restart_functions,
|
|
||||||
git_install_requested,
|
git_install_requested,
|
||||||
git_clone_and_install,
|
git_clone_and_install,
|
||||||
os_release,
|
os_release,
|
||||||
@@ -106,23 +105,12 @@ BASE_SERVICES = [
|
|||||||
'keystone',
|
'keystone',
|
||||||
]
|
]
|
||||||
|
|
||||||
# ubuntu packages that must not be installed when deploying from git
|
# ubuntu packages that should not be installed when deploying from git
|
||||||
GIT_PACKAGE_BLACKLIST = [
|
GIT_PACKAGE_BLACKLIST = [
|
||||||
'keystone',
|
'keystone',
|
||||||
'python-keystoneclient',
|
'python-keystoneclient',
|
||||||
]
|
]
|
||||||
|
|
||||||
# functions used in GIT_RESTART_MAP
|
|
||||||
def git_start_stop_keystone(action):
|
|
||||||
_git_start_stop_keystone(action)
|
|
||||||
|
|
||||||
# Services in this map must not be started/stopped by init scripts when
|
|
||||||
# deployed from git. Instead, the charm-defined functions must be used to
|
|
||||||
# start/stop processes.
|
|
||||||
GIT_RESTART_MAP = {
|
|
||||||
'keystone': git_start_stop_keystone,
|
|
||||||
}
|
|
||||||
|
|
||||||
API_PORTS = {
|
API_PORTS = {
|
||||||
'keystone-admin': config('admin-port'),
|
'keystone-admin': config('admin-port'),
|
||||||
'keystone-public': config('service-port')
|
'keystone-public': config('service-port')
|
||||||
@@ -251,13 +239,14 @@ def register_configs():
|
|||||||
|
|
||||||
|
|
||||||
def restart_map():
|
def restart_map():
|
||||||
restart_map = OrderedDict([(cfg, v['services'])
|
#TODO(coreycb): For deploy from git support, add function pointer restart
|
||||||
|
# support to charm-helpers in restart_on_change(). Then we
|
||||||
|
# can pass git_restart_keystone() to restart keystone, since
|
||||||
|
# upstart script isn't available.
|
||||||
|
return OrderedDict([(cfg, v['services'])
|
||||||
for cfg, v in resource_map().iteritems()
|
for cfg, v in resource_map().iteritems()
|
||||||
if v['services']])
|
if v['services']])
|
||||||
if git_install_requested():
|
|
||||||
restart_map = git_insert_restart_functions(restart_map,
|
|
||||||
GIT_RESTART_MAP)
|
|
||||||
return restart_map
|
|
||||||
|
|
||||||
def determine_ports():
|
def determine_ports():
|
||||||
'''Assemble a list of API ports for services we are managing'''
|
'''Assemble a list of API ports for services we are managing'''
|
||||||
@@ -320,7 +309,7 @@ def migrate_database():
|
|||||||
'''Runs keystone-manage to initialize a new database or migrate existing'''
|
'''Runs keystone-manage to initialize a new database or migrate existing'''
|
||||||
log('Migrating the keystone database.', level=INFO)
|
log('Migrating the keystone database.', level=INFO)
|
||||||
if git_install_requested():
|
if git_install_requested():
|
||||||
git_start_stop_keystone('stop')
|
git_stop_keystone()
|
||||||
else:
|
else:
|
||||||
service_stop('keystone')
|
service_stop('keystone')
|
||||||
# NOTE(jamespage) > icehouse creates a log file as root so use
|
# NOTE(jamespage) > icehouse creates a log file as root so use
|
||||||
@@ -329,7 +318,7 @@ def migrate_database():
|
|||||||
cmd = ['sudo', '-u', 'keystone', 'keystone-manage', 'db_sync']
|
cmd = ['sudo', '-u', 'keystone', 'keystone-manage', 'db_sync']
|
||||||
subprocess.check_output(cmd)
|
subprocess.check_output(cmd)
|
||||||
if git_install_requested():
|
if git_install_requested():
|
||||||
git_start_stop_keystone('start')
|
git_start_keystone()
|
||||||
else:
|
else:
|
||||||
service_start('keystone')
|
service_start('keystone')
|
||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
@@ -954,12 +943,11 @@ def git_post_install():
|
|||||||
for conf, files in configs.iteritems():
|
for conf, files in configs.iteritems():
|
||||||
shutil.copyfile(files['src'], files['dest'])
|
shutil.copyfile(files['src'], files['dest'])
|
||||||
|
|
||||||
git_start_stop_keystone('start')
|
git_start_keystone()
|
||||||
|
|
||||||
|
|
||||||
def _git_start_stop_keystone(action):
|
def git_start_keystone():
|
||||||
"""Start, stop, or restart keystone-all service."""
|
"""Start keystone-all service."""
|
||||||
if action == 'start':
|
|
||||||
subprocess.check_call(['start-stop-daemon', '--start',
|
subprocess.check_call(['start-stop-daemon', '--start',
|
||||||
'--name', 'keystone',
|
'--name', 'keystone',
|
||||||
'--background',
|
'--background',
|
||||||
@@ -967,9 +955,9 @@ def _git_start_stop_keystone(action):
|
|||||||
'--chdir', '/var/lib/keystone',
|
'--chdir', '/var/lib/keystone',
|
||||||
'--name', 'keystone',
|
'--name', 'keystone',
|
||||||
'--exec', '/usr/local/bin/keystone-all'])
|
'--exec', '/usr/local/bin/keystone-all'])
|
||||||
elif action == 'stop':
|
|
||||||
|
|
||||||
|
def git_stop_keystone():
|
||||||
|
"""Stop keystone-all service."""
|
||||||
subprocess.check_call(['start-stop-daemon', '--stop',
|
subprocess.check_call(['start-stop-daemon', '--stop',
|
||||||
'--name', 'keystone-all'])
|
'--name', 'keystone-all'])
|
||||||
elif action == 'restart':
|
|
||||||
git_start_stop_keystone('stop')
|
|
||||||
git_start_stop_keystone('start')
|
|
||||||
|
|||||||
Reference in New Issue
Block a user