From 80054695959ed1e115f57cec8e6665d77337bea0 Mon Sep 17 00:00:00 2001 From: Corey Bryant Date: Tue, 5 May 2015 19:57:28 +0000 Subject: [PATCH] Point upstart scripts at venv binaries --- hooks/neutron_ovs_utils.py | 4 ++++ templates/git/upstart/neutron-ovs-cleanup.upstart | 2 +- .../git/upstart/neutron-plugin-openvswitch-agent.upstart | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hooks/neutron_ovs_utils.py b/hooks/neutron_ovs_utils.py index 1b732a24..4e3d5b94 100644 --- a/hooks/neutron_ovs_utils.py +++ b/hooks/neutron_ovs_utils.py @@ -21,6 +21,7 @@ from charmhelpers.contrib.network.ovs import ( full_restart, ) from charmhelpers.core.hookenv import ( + charm_dir, config, ) from charmhelpers.contrib.openstack.neutron import ( @@ -265,10 +266,12 @@ def git_post_install(projects_yaml): render('git/neutron_sudoers', '/etc/sudoers.d/neutron_sudoers', {}, perms=0o440) + bin_dir = os.path.join(charm_dir(), 'venv/bin') neutron_ovs_agent_context = { 'service_description': 'Neutron OpenvSwitch Plugin Agent', 'charm_name': 'neutron-openvswitch', 'process_name': 'neutron-openvswitch-agent', + 'executable_name': os.path.join(bin_dir, 'neutron-openvswitch-agent'), 'cleanup_process_name': 'neutron-ovs-cleanup', 'plugin_config': '/etc/neutron/plugins/ml2/ml2_conf.ini', 'log_file': '/var/log/neutron/openvswitch-agent.log', @@ -278,6 +281,7 @@ def git_post_install(projects_yaml): 'service_description': 'Neutron OpenvSwitch Cleanup', 'charm_name': 'neutron-openvswitch', 'process_name': 'neutron-ovs-cleanup', + 'executable_name': os.path.join(bin_dir, 'neutron-ovs-cleanup'), 'log_file': '/var/log/neutron/ovs-cleanup.log', } diff --git a/templates/git/upstart/neutron-ovs-cleanup.upstart b/templates/git/upstart/neutron-ovs-cleanup.upstart index cbbd0db2..e7e809d4 100644 --- a/templates/git/upstart/neutron-ovs-cleanup.upstart +++ b/templates/git/upstart/neutron-ovs-cleanup.upstart @@ -11,7 +11,7 @@ end script pre-start script [ ! -x /usr/bin/{{ process_name }} ] && exit 0 - start-stop-daemon --start --chuid neutron --exec /usr/local/bin/{{ process_name }} -- \ + start-stop-daemon --start --chuid neutron --exec {{ executable_name }} -- \ --log-file /var/log/neutron/{{ log_file }} \ --config-file /etc/neutron/neutron.conf --verbose end script diff --git a/templates/git/upstart/neutron-plugin-openvswitch-agent.upstart b/templates/git/upstart/neutron-plugin-openvswitch-agent.upstart index 17a82edb..40f002c2 100644 --- a/templates/git/upstart/neutron-plugin-openvswitch-agent.upstart +++ b/templates/git/upstart/neutron-plugin-openvswitch-agent.upstart @@ -13,6 +13,6 @@ pre-start script chown neutron:root /var/run/neutron end script -exec start-stop-daemon --start --chuid neutron --exec /usr/local/bin/{{ process_name }} -- \ +exec start-stop-daemon --start --chuid neutron --exec {{ executable_name }} -- \ --config-file=/etc/neutron/neutron.conf --config-file={{ plugin_config }} \ --log-file={{ log_file }}