diff --git a/hooks/lib/openstack_common.py b/hooks/lib/openstack_common.py index 3a6004ae..5c7bddff 100644 --- a/hooks/lib/openstack_common.py +++ b/hooks/lib/openstack_common.py @@ -244,7 +244,7 @@ def configure_haproxy(units, service_ports, template_dir=None): with open(HAPROXY_DEFAULT, 'w') as f: f.write('ENABLED=1') -def save_script_rc(script_path="scriptrc", **env_vars): +def save_script_rc(script_path="scripts/scriptrc", **env_vars): """ Write an rc file in the charm-delivered directory containing exported environment variables provided by env_vars. Any charm scripts run diff --git a/add_to_cluster b/scripts/add_to_cluster similarity index 100% rename from add_to_cluster rename to scripts/add_to_cluster diff --git a/health_checks.d/service_ports_live b/scripts/health_checks.d/service_ports_live similarity index 82% rename from health_checks.d/service_ports_live rename to scripts/health_checks.d/service_ports_live index 40d3873e..54eccb72 100755 --- a/health_checks.d/service_ports_live +++ b/scripts/health_checks.d/service_ports_live @@ -1,8 +1,8 @@ #!/bin/bash # Validate that service ports are active HEALTH_DIR=`dirname $0` -UNIT_DIR=`dirname $HEALTH_DIR` -. $UNIT_DIR/scriptrc +SCRIPTS_DIR=`dirname $HEALTH_DIR` +. $SCRIPTS_DIR/scriptrc set -e # Grab any OPENSTACK_PORT* environment variables diff --git a/health_checks.d/service_running b/scripts/health_checks.d/service_running similarity index 68% rename from health_checks.d/service_running rename to scripts/health_checks.d/service_running index 18f9c620..8fe56e13 100755 --- a/health_checks.d/service_running +++ b/scripts/health_checks.d/service_running @@ -1,13 +1,13 @@ #!/bin/bash # Validate that service is running HEALTH_DIR=`dirname $0` -UNIT_DIR=`dirname $HEALTH_DIR` -. $UNIT_DIR/scriptrc +SCRIPTS_DIR=`dirname $HEALTH_DIR` +. $SCRIPTS_DIR/scriptrc set -e # Grab any OPENSTACK_SERVICE* environment variables openstack_service_names=`env| awk -F '=' '(/OPENSTACK_SERVICE/){print $2}'` for service_name in $openstack_service_names do - service $service_name status | grep -q running + service $service_name status 2>/dev/null | grep -q running done diff --git a/remove_from_cluster b/scripts/remove_from_cluster similarity index 100% rename from remove_from_cluster rename to scripts/remove_from_cluster