Skip to content

Commit

Permalink
Merge "Added check for picking service name as per ostype" into R3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Aug 29, 2016
2 parents 5824ff7 + 6161faf commit 8dd8aec
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion fabfile/tasks/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
is_ceilometer_compute_install_supported, \
is_ceilometer_contrail_plugin_install_supported

SERVICE_NAMES = {
'keystone' : {'centos' : 'openstack-keystone',
'centoslinux' : 'openstack-keystone'}
}

@task
@parallel(pool_size=20)
@roles('all')
Expand Down Expand Up @@ -1043,9 +1048,11 @@ def update_config_option(role, file_path, section, option, value, service):
USAGE:fab update_config_option:openstack,/etc/keystone/keystone.conf,token,expiration,86400,keystone
"""
cmd1 = "openstack-config --set " + file_path + " " + section + " " + option + " " + value
cmd2= "service " + service + " restart"
for host in env.roledefs[role]:
with settings(host_string=host, password=get_env_passwords(host)):
ostype = detect_ostype()
service_name = SERVICE_NAMES.get(service, {}).get(ostype, service)
cmd2 = "service " + service_name + " restart"
sudo(cmd1)
sudo(cmd2)
# end update_config_option
Expand Down

0 comments on commit 8dd8aec

Please sign in to comment.