From 523f48803609b35350b624244fa73b1030c1d5fa Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Tue, 13 Oct 2015 11:03:03 +1100 Subject: [PATCH] Namespace XTRACE commands I noticed this when debugging some grenade issues failures. An include of grenade/functions stores the current value of XTRACE (on) and disables xtrace for the rest of the import. We then include devstack's "functions" library, which now overwrites the stored value of XTRACE the current state; i.e. disabled. When it finishes it restores the prior state (disabled), and then grenade restores the same value of XTRACE (disabled). The result is that xtrace is incorrectly disabled until the next time it just happens to be turned on. The solution is to name-space the store of the current-value of xtrace so when we finish sourcing a file, we always restore the tracing value to what it was when we entered. Some files had already discovered this. In general there is inconsistency around the setting of the variable, and a lot of obvious copy-paste. This brings consistency across all files by using _XTRACE_* prefixes for the sotre/restore of tracing values. Change-Id: Iba7739eada5711d9c269cb4127fa712e9f961695 --- functions | 4 ++-- functions-common | 4 ++-- inc/meta-config | 4 ++-- lib/apache | 4 ++-- lib/ceph | 4 ++-- lib/cinder | 4 ++-- lib/cinder_backends/ceph | 4 ++-- lib/cinder_backends/glusterfs | 4 ++-- lib/cinder_backends/lvm | 4 ++-- lib/cinder_backends/netapp_iscsi | 4 ++-- lib/cinder_backends/netapp_nfs | 4 ++-- lib/cinder_backends/nfs | 4 ++-- lib/cinder_backends/solidfire | 4 ++-- lib/cinder_backends/vmdk | 4 ++-- lib/cinder_backends/xiv | 4 ++-- lib/cinder_plugins/XenAPINFS | 4 ++-- lib/cinder_plugins/glusterfs | 4 ++-- lib/cinder_plugins/nfs | 4 ++-- lib/cinder_plugins/sheepdog | 4 ++-- lib/cinder_plugins/vsphere | 4 ++-- lib/database | 4 ++-- lib/databases/mysql | 4 ++-- lib/databases/postgresql | 4 ++-- lib/dlm | 4 ++-- lib/dstat | 4 ++-- lib/glance | 4 ++-- lib/heat | 4 ++-- lib/horizon | 4 ++-- lib/infra | 4 ++-- lib/ironic | 8 ++++---- lib/keystone | 4 ++-- lib/ldap | 4 ++-- lib/lvm | 4 ++-- lib/neutron-legacy | 4 ++-- lib/neutron_plugins/bigswitch_floodlight | 4 ++-- lib/neutron_plugins/brocade | 4 ++-- lib/neutron_plugins/cisco | 4 ++-- lib/neutron_plugins/embrane | 5 +++-- lib/neutron_plugins/linuxbridge_agent | 4 ++-- lib/neutron_plugins/ml2 | 4 ++-- lib/neutron_plugins/nuage | 4 ++-- lib/neutron_plugins/openvswitch | 5 +++-- lib/neutron_plugins/openvswitch_agent | 4 ++-- lib/neutron_plugins/ovs_base | 4 ++-- lib/neutron_plugins/services/firewall | 4 ++-- lib/neutron_plugins/services/loadbalancer | 4 ++-- lib/neutron_plugins/services/metering | 5 +++-- lib/neutron_plugins/services/vpn | 4 ++-- lib/neutron_thirdparty/bigswitch_floodlight | 4 ++-- lib/nova | 4 ++-- lib/nova_plugins/functions-libvirt | 4 ++-- lib/nova_plugins/hypervisor-fake | 4 ++-- lib/nova_plugins/hypervisor-ironic | 4 ++-- lib/nova_plugins/hypervisor-libvirt | 4 ++-- lib/nova_plugins/hypervisor-openvz | 4 ++-- lib/nova_plugins/hypervisor-vsphere | 4 ++-- lib/nova_plugins/hypervisor-xenserver | 4 ++-- lib/oslo | 4 ++-- lib/rpc_backend | 4 ++-- lib/swift | 4 ++-- lib/tempest | 4 ++-- lib/template | 4 ++-- stack.sh | 7 +++++-- 63 files changed, 134 insertions(+), 128 deletions(-) diff --git a/functions b/functions index 34da1ba733..762fc472c2 100644 --- a/functions +++ b/functions @@ -22,7 +22,7 @@ source ${FUNC_DIR}/inc/python source ${FUNC_DIR}/inc/rootwrap # Save trace setting -XTRACE=$(set +o | grep xtrace) +_XTRACE_FUNCTIONS=$(set +o | grep xtrace) set +o xtrace # Check if a function already exists @@ -603,7 +603,7 @@ function create_disk { } # Restore xtrace -$XTRACE +$_XTRACE_FUNCTIONS # Local variables: # mode: shell-script diff --git a/functions-common b/functions-common index 6a065ba83c..d68ae77971 100644 --- a/functions-common +++ b/functions-common @@ -32,7 +32,7 @@ # # Save trace setting -XTRACE=$(set +o | grep xtrace) +_XTRACE_FUNCTIONS_COMMON=$(set +o | grep xtrace) set +o xtrace # ensure we don't re-source this in the same environment @@ -2254,7 +2254,7 @@ function time_totals { } # Restore xtrace -$XTRACE +$_XTRACE_FUNCTIONS_COMMON # Local variables: # mode: shell-script diff --git a/inc/meta-config b/inc/meta-config index b9ab6b207f..b6fe437802 100644 --- a/inc/meta-config +++ b/inc/meta-config @@ -20,7 +20,7 @@ # file-name is the destination of the config file # Save trace setting -INC_META_XTRACE=$(set +o | grep xtrace) +_XTRACE_INC_META=$(set +o | grep xtrace) set +o xtrace @@ -197,7 +197,7 @@ function merge_config_group { # Restore xtrace -$INC_META_XTRACE +$_XTRACE_INC_META # Local variables: # mode: shell-script diff --git a/lib/apache b/lib/apache index 17526c74d0..c9e02a2b58 100644 --- a/lib/apache +++ b/lib/apache @@ -19,7 +19,7 @@ # - restart_apache_server # Save trace setting -XTRACE=$(set +o | grep xtrace) +_XTRACE_LIB_APACHE=$(set +o | grep xtrace) set +o xtrace # Allow overriding the default Apache user and group, default to @@ -191,7 +191,7 @@ function restart_apache_server { } # Restore xtrace -$XTRACE +$_XTRACE_LIB_APACHE # Tell emacs to use shell-script-mode ## Local variables: diff --git a/lib/ceph b/lib/ceph index f573136a4e..4ac498ab97 100644 --- a/lib/ceph +++ b/lib/ceph @@ -18,7 +18,7 @@ # - cleanup_ceph # Save trace setting -XTRACE=$(set +o | grep xtrace) +_XTRACE_LIB_CEPH=$(set +o | grep xtrace) set +o xtrace @@ -375,7 +375,7 @@ function stop_ceph { # Restore xtrace -$XTRACE +$_XTRACE_LIB_CEPH ## Local variables: ## mode: shell-script diff --git a/lib/cinder b/lib/cinder index 1307c11f7a..70b198c2e9 100644 --- a/lib/cinder +++ b/lib/cinder @@ -20,7 +20,7 @@ # - cleanup_cinder # Save trace setting -XTRACE=$(set +o | grep xtrace) +_XTRACE_CINDER=$(set +o | grep xtrace) set +o xtrace @@ -567,7 +567,7 @@ function create_cinder_volume_group { # Restore xtrace -$XTRACE +$_XTRACE_CINDER # Tell emacs to use shell-script-mode ## Local variables: diff --git a/lib/cinder_backends/ceph b/lib/cinder_backends/ceph index 7e9d2d334e..c21350ba01 100644 --- a/lib/cinder_backends/ceph +++ b/lib/cinder_backends/ceph @@ -22,7 +22,7 @@ # Save trace setting -MY_XTRACE=$(set +o | grep xtrace) +_XTRACE_CINDER_CEPH=$(set +o | grep xtrace) set +o xtrace @@ -76,7 +76,7 @@ function configure_cinder_backend_ceph { } # Restore xtrace -$MY_XTRACE +$_XTRACE_CINDER_CEPH # Local variables: # mode: shell-script diff --git a/lib/cinder_backends/glusterfs b/lib/cinder_backends/glusterfs index 00c62e04cd..4e34f8ef6c 100644 --- a/lib/cinder_backends/glusterfs +++ b/lib/cinder_backends/glusterfs @@ -19,7 +19,7 @@ # configure_cinder_backend_glusterfs - Configure Cinder for GlusterFS backends # Save trace setting -GLUSTERFS_XTRACE=$(set +o | grep xtrace) +_XTRACE_CINDER_GLUSTERFS=$(set +o | grep xtrace) set +o xtrace @@ -41,7 +41,7 @@ function configure_cinder_backend_glusterfs { # Restore xtrace -$GLUSTERFS_XTRACE +$_XTRACE_CINDER_GLUSTERFS # Local variables: # mode: shell-script diff --git a/lib/cinder_backends/lvm b/lib/cinder_backends/lvm index 411b82c190..d927f9cd6b 100644 --- a/lib/cinder_backends/lvm +++ b/lib/cinder_backends/lvm @@ -22,7 +22,7 @@ # Save trace setting -MY_XTRACE=$(set +o | grep xtrace) +_XTRACE_CINDER_LVM=$(set +o | grep xtrace) set +o xtrace @@ -68,7 +68,7 @@ function init_cinder_backend_lvm { } # Restore xtrace -$MY_XTRACE +$_XTRACE_CINDER_LVM # mode: shell-script # End: diff --git a/lib/cinder_backends/netapp_iscsi b/lib/cinder_backends/netapp_iscsi index be9442eb83..5cce30a6d3 100644 --- a/lib/cinder_backends/netapp_iscsi +++ b/lib/cinder_backends/netapp_iscsi @@ -20,7 +20,7 @@ # configure_cinder_backend_netapp_iscsi - configure iSCSI # Save trace setting -MY_XTRACE=$(set +o | grep xtrace) +_XTRACE_CINDER_NETAPP=$(set +o | grep xtrace) set +o xtrace @@ -59,7 +59,7 @@ function configure_cinder_backend_netapp_iscsi { # Restore xtrace -$MY_XTRACE +$_XTRACE_CINDER_NETAPP # Local variables: # mode: shell-script diff --git a/lib/cinder_backends/netapp_nfs b/lib/cinder_backends/netapp_nfs index dc919ad86b..7ba36d2a3b 100644 --- a/lib/cinder_backends/netapp_nfs +++ b/lib/cinder_backends/netapp_nfs @@ -20,7 +20,7 @@ # configure_cinder_backend_netapp_nfs - configure NFS # Save trace setting -MY_XTRACE=$(set +o | grep xtrace) +_XTRACE_CINDER_NETAPP=$(set +o | grep xtrace) set +o xtrace @@ -70,7 +70,7 @@ function cleanup_cinder_backend_netapp_nfs { # Restore xtrace -$MY_XTRACE +$_XTRACE_CINDER_NETAPP # Local variables: # mode: shell-script diff --git a/lib/cinder_backends/nfs b/lib/cinder_backends/nfs index fc51b2b440..89a37a1f02 100644 --- a/lib/cinder_backends/nfs +++ b/lib/cinder_backends/nfs @@ -19,7 +19,7 @@ # configure_cinder_backend_nfs - Configure Cinder for NFS backends # Save trace setting -NFS_XTRACE=$(set +o | grep xtrace) +_XTRACE_CINDER_NFS=$(set +o | grep xtrace) set +o xtrace @@ -38,7 +38,7 @@ function configure_cinder_backend_nfs { # Restore xtrace -$NFS_XTRACE +$_XTRACE_CINDER_NFS # Local variables: # mode: shell-script diff --git a/lib/cinder_backends/solidfire b/lib/cinder_backends/solidfire index 7cc70fc86d..16bc527863 100644 --- a/lib/cinder_backends/solidfire +++ b/lib/cinder_backends/solidfire @@ -17,7 +17,7 @@ # configure_cinder_driver - make configuration changes, including those to other services # Save trace setting -MY_XTRACE=$(set +o | grep xtrace) +_XTRACE_CINDER_SOLIDFIRE=$(set +o | grep xtrace) set +o xtrace @@ -42,7 +42,7 @@ function configure_cinder_backend_solidfire { # Restore xtrace -$MY_XTRACE +$_XTRACE_CINDER_SOLIDFIRE # Local variables: # mode: shell-script diff --git a/lib/cinder_backends/vmdk b/lib/cinder_backends/vmdk index d5b945354b..3a6a5cf2ff 100644 --- a/lib/cinder_backends/vmdk +++ b/lib/cinder_backends/vmdk @@ -15,7 +15,7 @@ # configure_cinder_backend_vmdk - Configure Cinder for VMware vmdk backends # Save trace setting -VMDK_XTRACE=$(set +o | grep xtrace) +_XTRACE_CINDER_VMDK=$(set +o | grep xtrace) set +o xtrace @@ -40,7 +40,7 @@ function configure_cinder_backend_vmdk { # Restore xtrace -$VMDK_XTRACE +$_XTRACE_CINDER_VMDK # Local variables: # mode: shell-script diff --git a/lib/cinder_backends/xiv b/lib/cinder_backends/xiv index 6eadaae93b..e8b5da05d5 100644 --- a/lib/cinder_backends/xiv +++ b/lib/cinder_backends/xiv @@ -42,7 +42,7 @@ # configure_cinder_backend_xiv - Configure Cinder for xiv backends # Save trace setting -XIV_XTRACE=$(set +o | grep xtrace) +_XTRACE_CINDER_XIV=$(set +o | grep xtrace) set +o xtrace # Defaults @@ -79,7 +79,7 @@ function configure_cinder_backend_xiv { } # Restore xtrace -$XIV_XTRACE +$_XTRACE_CINDER_XIV # Local variables: # mode: shell-script diff --git a/lib/cinder_plugins/XenAPINFS b/lib/cinder_plugins/XenAPINFS index f7306955cb..92135e7c4f 100644 --- a/lib/cinder_plugins/XenAPINFS +++ b/lib/cinder_plugins/XenAPINFS @@ -15,7 +15,7 @@ # configure_cinder_driver - make configuration changes, including those to other services # Save trace setting -MY_XTRACE=$(set +o | grep xtrace) +_XTRACE_CINDER_XENAPINFS=$(set +o | grep xtrace) set +o xtrace @@ -39,7 +39,7 @@ function configure_cinder_driver { } # Restore xtrace -$MY_XTRACE +$_XTRACE_CINDER_XENAPINFS # Local variables: # mode: shell-script diff --git a/lib/cinder_plugins/glusterfs b/lib/cinder_plugins/glusterfs index 35ceb27ce1..329dd6c649 100644 --- a/lib/cinder_plugins/glusterfs +++ b/lib/cinder_plugins/glusterfs @@ -15,7 +15,7 @@ # configure_cinder_driver - make configuration changes, including those to other services # Save trace setting -MY_XTRACE=$(set +o | grep xtrace) +_XTRACE_CINDER_GLUSTERFS=$(set +o | grep xtrace) set +o xtrace @@ -45,7 +45,7 @@ function configure_cinder_driver { } # Restore xtrace -$MY_XTRACE +$_XTRACE_CINDER_GLUSTERFS # Local variables: # mode: shell-script diff --git a/lib/cinder_plugins/nfs b/lib/cinder_plugins/nfs index 83b39932cf..6e4ffe068e 100644 --- a/lib/cinder_plugins/nfs +++ b/lib/cinder_plugins/nfs @@ -15,7 +15,7 @@ # configure_cinder_driver - make configuration changes, including those to other services # Save trace setting -MY_XTRACE=$(set +o | grep xtrace) +_XTRACE_CINDER_NFS=$(set +o | grep xtrace) set +o xtrace @@ -36,7 +36,7 @@ function configure_cinder_driver { } # Restore xtrace -$MY_XTRACE +$_XTRACE_CINDER_NFS # Local variables: # mode: shell-script diff --git a/lib/cinder_plugins/sheepdog b/lib/cinder_plugins/sheepdog index ca343f708b..558de46c6d 100644 --- a/lib/cinder_plugins/sheepdog +++ b/lib/cinder_plugins/sheepdog @@ -15,7 +15,7 @@ # configure_cinder_driver - make configuration changes, including those to other services # Save trace setting -MY_XTRACE=$(set +o | grep xtrace) +_XTRACE_CINDER_SHEEPDOG=$(set +o | grep xtrace) set +o xtrace @@ -34,7 +34,7 @@ function configure_cinder_driver { } # Restore xtrace -$MY_XTRACE +$_XTRACE_CINDER_SHEEPDOG # Local variables: # mode: shell-script diff --git a/lib/cinder_plugins/vsphere b/lib/cinder_plugins/vsphere index f14ddf0998..1b28ffe602 100644 --- a/lib/cinder_plugins/vsphere +++ b/lib/cinder_plugins/vsphere @@ -15,7 +15,7 @@ # configure_cinder_driver - make configuration changes, including those to other services # Save trace setting -MY_XTRACE=$(set +o | grep xtrace) +_XTRACE_CINDER_VSPHERE=$(set +o | grep xtrace) set +o xtrace @@ -37,7 +37,7 @@ function configure_cinder_driver { } # Restore xtrace -$MY_XTRACE +$_XTRACE_CINDER_VSPHERE # Local variables: # mode: shell-script diff --git a/lib/database b/lib/database index 13740b90e6..0d720527df 100644 --- a/lib/database +++ b/lib/database @@ -20,7 +20,7 @@ # and call register_database $DATABASE_TYPE # Save trace setting -XTRACE=$(set +o | grep xtrace) +_XTRACE_LIB_DB=$(set +o | grep xtrace) set +o xtrace DATABASE_BACKENDS="" @@ -137,7 +137,7 @@ function database_connection_url { # Restore xtrace -$XTRACE +$_XTRACE_LIB_DB # Tell emacs to use shell-script-mode ## Local variables: diff --git a/lib/databases/mysql b/lib/databases/mysql index cc74b33327..1bbbd62cc3 100644 --- a/lib/databases/mysql +++ b/lib/databases/mysql @@ -8,7 +8,7 @@ # - DATABASE_{HOST,USER,PASSWORD} must be defined # Save trace setting -MY_XTRACE=$(set +o | grep xtrace) +_XTRACE_DB_MYSQL=$(set +o | grep xtrace) set +o xtrace MYSQL_DRIVER=${MYSQL_DRIVER:-PyMySQL} @@ -178,7 +178,7 @@ function database_connection_url_mysql { # Restore xtrace -$MY_XTRACE +$_XTRACE_DB_MYSQL # Local variables: # mode: shell-script diff --git a/lib/databases/postgresql b/lib/databases/postgresql index 78c7bedc90..913e8ffacd 100644 --- a/lib/databases/postgresql +++ b/lib/databases/postgresql @@ -8,7 +8,7 @@ # - DATABASE_{HOST,USER,PASSWORD} must be defined # Save trace setting -PG_XTRACE=$(set +o | grep xtrace) +_XTRACE_PG=$(set +o | grep xtrace) set +o xtrace @@ -119,7 +119,7 @@ function database_connection_url_postgresql { # Restore xtrace -$PG_XTRACE +$_XTRACE_PG # Local variables: # mode: shell-script diff --git a/lib/dlm b/lib/dlm index 95e9b0ac3d..74eb67ee8f 100644 --- a/lib/dlm +++ b/lib/dlm @@ -19,7 +19,7 @@ # - cleanup_dlm # Save trace setting -XTRACE=$(set +o | grep xtrace) +_XTRACE_DLM=$(set +o | grep xtrace) set +o xtrace @@ -100,7 +100,7 @@ function install_dlm { } # Restore xtrace -$XTRACE +$_XTRACE_DLM # Tell emacs to use shell-script-mode ## Local variables: diff --git a/lib/dstat b/lib/dstat index fe4790b12d..b705948094 100644 --- a/lib/dstat +++ b/lib/dstat @@ -13,7 +13,7 @@ # - stop_dstat # Save trace setting -XTRACE=$(set +o | grep xtrace) +_XTRACE_DSTAT=$(set +o | grep xtrace) set +o xtrace # start_dstat() - Start running processes, including screen @@ -34,4 +34,4 @@ function stop_dstat { } # Restore xtrace -$XTRACE +$_XTRACE_DSTAT diff --git a/lib/glance b/lib/glance index 2eb93a46e6..eb5832e910 100644 --- a/lib/glance +++ b/lib/glance @@ -21,7 +21,7 @@ # - cleanup_glance # Save trace setting -XTRACE=$(set +o | grep xtrace) +_XTRACE_GLANCE=$(set +o | grep xtrace) set +o xtrace @@ -403,7 +403,7 @@ function stop_glance { } # Restore xtrace -$XTRACE +$_XTRACE_GLANCE # Tell emacs to use shell-script-mode ## Local variables: diff --git a/lib/heat b/lib/heat index e42bdf0b9e..54666a5212 100644 --- a/lib/heat +++ b/lib/heat @@ -23,7 +23,7 @@ # - cleanup_heat # Save trace setting -XTRACE=$(set +o | grep xtrace) +_XTRACE_HEAT=$(set +o | grep xtrace) set +o xtrace @@ -464,7 +464,7 @@ function build_heat_pip_mirror { } # Restore xtrace -$XTRACE +$_XTRACE_HEAT # Tell emacs to use shell-script-mode ## Local variables: diff --git a/lib/horizon b/lib/horizon index ff63b06ab2..67181fcf29 100644 --- a/lib/horizon +++ b/lib/horizon @@ -19,7 +19,7 @@ # - cleanup_horizon # Save trace setting -XTRACE=$(set +o | grep xtrace) +_XTRACE_HORIZON=$(set +o | grep xtrace) set +o xtrace @@ -193,7 +193,7 @@ function _prepare_message_catalog_compilation { # Restore xtrace -$XTRACE +$_XTRACE_HORIZON # Tell emacs to use shell-script-mode ## Local variables: diff --git a/lib/infra b/lib/infra index ab32efecd9..cf003cce01 100644 --- a/lib/infra +++ b/lib/infra @@ -15,7 +15,7 @@ # - install_infra # Save trace setting -XTRACE=$(set +o | grep xtrace) +_XTRACE_INFRA=$(set +o | grep xtrace) set +o xtrace @@ -50,7 +50,7 @@ function install_infra { } # Restore xtrace -$XTRACE +$_XTRACE_INFRA # Tell emacs to use shell-script-mode ## Local variables: diff --git a/lib/ironic b/lib/ironic index 6a32983b24..23d8dda3ff 100644 --- a/lib/ironic +++ b/lib/ironic @@ -21,8 +21,8 @@ # - cleanup_ironic # Save trace and pipefail settings -XTRACE=$(set +o | grep xtrace) -PIPEFAIL=$(set +o | grep pipefail) +_XTRACE_IRONIC=$(set +o | grep xtrace) +_PIPEFAIL_IRONIC=$(set +o | grep pipefail) set +o xtrace set +o pipefail @@ -855,8 +855,8 @@ function cleanup_baremetal_basic_ops { } # Restore xtrace + pipefail -$XTRACE -$PIPEFAIL +$_XTRACE_IRONIC +$_PIPEFAIL_IRONIC # Tell emacs to use shell-script-mode ## Local variables: diff --git a/lib/keystone b/lib/keystone index 5a2afbfe02..b19202b0f7 100644 --- a/lib/keystone +++ b/lib/keystone @@ -28,7 +28,7 @@ # - _cleanup_keystone_apache_wsgi # Save trace setting -XTRACE=$(set +o | grep xtrace) +_XTRACE_KEYSTONE=$(set +o | grep xtrace) set +o xtrace # Defaults @@ -592,7 +592,7 @@ function stop_keystone { # Restore xtrace -$XTRACE +$_XTRACE_KEYSTONE # Tell emacs to use shell-script-mode ## Local variables: diff --git a/lib/ldap b/lib/ldap index 0414fea639..65056aea2f 100644 --- a/lib/ldap +++ b/lib/ldap @@ -8,7 +8,7 @@ # - install_ldap() # Save trace setting -XTRACE=$(set +o | grep xtrace) +_XTRACE_LDAP=$(set +o | grep xtrace) set +o xtrace @@ -166,7 +166,7 @@ function clear_ldap_state { } # Restore xtrace -$XTRACE +$_XTRACE_LDAP # Tell emacs to use shell-script-mode ## Local variables: diff --git a/lib/lvm b/lib/lvm index 468a99aecc..ae6023a836 100644 --- a/lib/lvm +++ b/lib/lvm @@ -16,7 +16,7 @@ # Save trace setting -MY_XTRACE=$(set +o | grep xtrace) +_XTRACE_LVM=$(set +o | grep xtrace) set +o xtrace @@ -182,7 +182,7 @@ function set_lvm_filter { } # Restore xtrace -$MY_XTRACE +$_XTRACE_LVM # mode: shell-script # End: diff --git a/lib/neutron-legacy b/lib/neutron-legacy index 978943dae2..d00630af70 100644 --- a/lib/neutron-legacy +++ b/lib/neutron-legacy @@ -357,7 +357,7 @@ else fi # Save trace setting -XTRACE=$(set +o | grep xtrace) +_XTRACE_NEUTRON=$(set +o | grep xtrace) set +o xtrace @@ -1492,7 +1492,7 @@ function is_provider_network { # Restore xtrace -$XTRACE +$_XTRACE_NEUTRON # Tell emacs to use shell-script-mode ## Local variables: diff --git a/lib/neutron_plugins/bigswitch_floodlight b/lib/neutron_plugins/bigswitch_floodlight index f52105e658..586ded79b4 100644 --- a/lib/neutron_plugins/bigswitch_floodlight +++ b/lib/neutron_plugins/bigswitch_floodlight @@ -4,7 +4,7 @@ # ------------------------------------ # Save trace setting -BS_XTRACE=$(set +o | grep xtrace) +_XTRACE_NEUTRON_BIGSWITCH=$(set +o | grep xtrace) set +o xtrace source $TOP_DIR/lib/neutron_plugins/ovs_base @@ -75,4 +75,4 @@ function neutron_plugin_check_adv_test_requirements { } # Restore xtrace -$BS_XTRACE +$_XTRACE_NEUTRON_BIGSWITCH diff --git a/lib/neutron_plugins/brocade b/lib/neutron_plugins/brocade index 953360e070..6ba0a66c3f 100644 --- a/lib/neutron_plugins/brocade +++ b/lib/neutron_plugins/brocade @@ -4,7 +4,7 @@ # ---------------------- # Save trace setting -BRCD_XTRACE=$(set +o | grep xtrace) +_XTRACE_NEUTRON_BROCADE=$(set +o | grep xtrace) set +o xtrace function is_neutron_ovs_base_plugin { @@ -81,4 +81,4 @@ function neutron_plugin_check_adv_test_requirements { } # Restore xtrace -$BRCD_XTRACE +$_XTRACE_NEUTRON_BROCADE diff --git a/lib/neutron_plugins/cisco b/lib/neutron_plugins/cisco index 7d0cf1af39..fc2cb8ad17 100644 --- a/lib/neutron_plugins/cisco +++ b/lib/neutron_plugins/cisco @@ -4,7 +4,7 @@ # --------------------------- # Save trace setting -CISCO_XTRACE=$(set +o | grep xtrace) +_XTRACE_NEUTRON_CISCO=$(set +o | grep xtrace) set +o xtrace # Scecify the VSM parameters @@ -154,4 +154,4 @@ function neutron_plugin_setup_interface_driver { } # Restore xtrace -$CISCO_XTRACE +$_XTRACE_NEUTRON_CISCO diff --git a/lib/neutron_plugins/embrane b/lib/neutron_plugins/embrane index 2028496ca1..385dab8354 100644 --- a/lib/neutron_plugins/embrane +++ b/lib/neutron_plugins/embrane @@ -4,7 +4,7 @@ # --------------------------- # Save trace setting -EMBR_XTRACE=$(set +o | grep xtrace) +_XTRACE_NEUTRON_EMBR=$(set +o | grep xtrace) set +o xtrace source $TOP_DIR/lib/neutron_plugins/openvswitch @@ -39,4 +39,5 @@ function neutron_plugin_configure_service { } # Restore xtrace -$EMBR_XTRACE +$_XTRACE_NEUTRON_EMBR + diff --git a/lib/neutron_plugins/linuxbridge_agent b/lib/neutron_plugins/linuxbridge_agent index f28bcfeadd..096722b096 100644 --- a/lib/neutron_plugins/linuxbridge_agent +++ b/lib/neutron_plugins/linuxbridge_agent @@ -4,7 +4,7 @@ # ----------------------------- # Save trace setting -PLUGIN_XTRACE=$(set +o | grep xtrace) +_XTRACE_NEUTRON_LB=$(set +o | grep xtrace) set +o xtrace function neutron_lb_cleanup { @@ -93,4 +93,4 @@ function neutron_plugin_check_adv_test_requirements { } # Restore xtrace -$PLUGIN_XTRACE +$_XTRACE_NEUTRON_LB diff --git a/lib/neutron_plugins/ml2 b/lib/neutron_plugins/ml2 index ace5335a78..30e1b036f3 100644 --- a/lib/neutron_plugins/ml2 +++ b/lib/neutron_plugins/ml2 @@ -4,7 +4,7 @@ # ------------------------------ # Save trace setting -ML2_XTRACE=$(set +o | grep xtrace) +_XTRACE_NEUTRON_ML2=$(set +o | grep xtrace) set +o xtrace # Enable this to simply and quickly enable tunneling with ML2. @@ -137,4 +137,4 @@ function has_neutron_plugin_security_group { } # Restore xtrace -$ML2_XTRACE +$_XTRACE_NEUTRON_ML2 diff --git a/lib/neutron_plugins/nuage b/lib/neutron_plugins/nuage index 9e5307ba53..61e634e453 100644 --- a/lib/neutron_plugins/nuage +++ b/lib/neutron_plugins/nuage @@ -4,7 +4,7 @@ # ---------------------- # Save trace setting -NU_XTRACE=$(set +o | grep xtrace) +_XTRACE_NEUTRON_NU=$(set +o | grep xtrace) set +o xtrace function neutron_plugin_create_nova_conf { @@ -66,4 +66,4 @@ function has_neutron_plugin_security_group { } # Restore xtrace -$NU_XTRACE +$_XTRACE_NEUTRON_NU diff --git a/lib/neutron_plugins/openvswitch b/lib/neutron_plugins/openvswitch index 891ab4982b..130eaacab3 100644 --- a/lib/neutron_plugins/openvswitch +++ b/lib/neutron_plugins/openvswitch @@ -7,7 +7,7 @@ # which has been removed in Juno. # Save trace setting -OVS_XTRACE=$(set +o | grep xtrace) +_XTRACE_NEUTRON_OVS=$(set +o | grep xtrace) set +o xtrace source $TOP_DIR/lib/neutron_plugins/openvswitch_agent @@ -56,4 +56,5 @@ function has_neutron_plugin_security_group { } # Restore xtrace -$OVS_XTRACE +$_XTRACE_NEUTRON_OVS + diff --git a/lib/neutron_plugins/openvswitch_agent b/lib/neutron_plugins/openvswitch_agent index 6a333939d0..b1acacd4f3 100644 --- a/lib/neutron_plugins/openvswitch_agent +++ b/lib/neutron_plugins/openvswitch_agent @@ -4,7 +4,7 @@ # ----------------------------- # Save trace setting -OVSA_XTRACE=$(set +o | grep xtrace) +_XTRACE_NEUTRON_OVSL2=$(set +o | grep xtrace) set +o xtrace source $TOP_DIR/lib/neutron_plugins/ovs_base @@ -132,4 +132,4 @@ function neutron_plugin_check_adv_test_requirements { } # Restore xtrace -$OVSA_XTRACE +$_XTRACE_NEUTRON_OVSL2 diff --git a/lib/neutron_plugins/ovs_base b/lib/neutron_plugins/ovs_base index d3fd198b08..91aff336fe 100644 --- a/lib/neutron_plugins/ovs_base +++ b/lib/neutron_plugins/ovs_base @@ -4,7 +4,7 @@ # ------------------------------------- # Save trace setting -OVSB_XTRACE=$(set +o | grep xtrace) +_XTRACE_NEUTRON_OVS_BASE=$(set +o | grep xtrace) set +o xtrace OVS_BRIDGE=${OVS_BRIDGE:-br-int} @@ -114,4 +114,4 @@ function _neutron_ovs_base_configure_nova_vif_driver { } # Restore xtrace -$OVSB_XTRACE +$_XTRACE_NEUTRON_OVS_BASE diff --git a/lib/neutron_plugins/services/firewall b/lib/neutron_plugins/services/firewall index 3496da82f8..1d81a21825 100644 --- a/lib/neutron_plugins/services/firewall +++ b/lib/neutron_plugins/services/firewall @@ -4,7 +4,7 @@ # --------------------------- # Save trace setting -FW_XTRACE=$(set +o | grep xtrace) +_XTRACE_NEUTRON_FIREWALL=$(set +o | grep xtrace) set +o xtrace FWAAS_PLUGIN=neutron_fwaas.services.firewall.fwaas_plugin.FirewallPlugin @@ -26,4 +26,4 @@ function neutron_fwaas_stop { } # Restore xtrace -$FW_XTRACE +$_XTRACE_NEUTRON_FIREWALL diff --git a/lib/neutron_plugins/services/loadbalancer b/lib/neutron_plugins/services/loadbalancer index 7865f6fd6e..b07d06c32b 100644 --- a/lib/neutron_plugins/services/loadbalancer +++ b/lib/neutron_plugins/services/loadbalancer @@ -4,7 +4,7 @@ # --------------------------- # Save trace setting -LB_XTRACE=$(set +o | grep xtrace) +_XTRACE_NEUTRON_LB=$(set +o | grep xtrace) set +o xtrace @@ -48,4 +48,4 @@ function neutron_lbaas_stop { } # Restore xtrace -$LB_XTRACE +$_XTRACE_NEUTRON_LB diff --git a/lib/neutron_plugins/services/metering b/lib/neutron_plugins/services/metering index c75ab19d4e..5fd2fdce44 100644 --- a/lib/neutron_plugins/services/metering +++ b/lib/neutron_plugins/services/metering @@ -4,7 +4,7 @@ # --------------------------- # Save trace setting -METER_XTRACE=$(set +o | grep xtrace) +_XTRACE_NETURON_METER=$(set +o | grep xtrace) set +o xtrace @@ -29,4 +29,5 @@ function neutron_metering_stop { } # Restore xtrace -$METER_XTRACE +$_XTRACE_NETURON_METER + diff --git a/lib/neutron_plugins/services/vpn b/lib/neutron_plugins/services/vpn index c0e7457413..8a379f588c 100644 --- a/lib/neutron_plugins/services/vpn +++ b/lib/neutron_plugins/services/vpn @@ -4,7 +4,7 @@ # --------------------------- # Save trace setting -VPN_XTRACE=$(set +o | grep xtrace) +_XTRACE_NEUTRON_VPN=$(set +o | grep xtrace) set +o xtrace @@ -53,4 +53,4 @@ function neutron_vpn_stop { } # Restore xtrace -$VPN_XTRACE +$_XTRACE_NEUTRON_VPN diff --git a/lib/neutron_thirdparty/bigswitch_floodlight b/lib/neutron_thirdparty/bigswitch_floodlight index e3f4689fd7..45a4f2e263 100644 --- a/lib/neutron_thirdparty/bigswitch_floodlight +++ b/lib/neutron_thirdparty/bigswitch_floodlight @@ -4,7 +4,7 @@ # ------------------------------------------ # Save trace setting -BS3_XTRACE=$(set +o | grep xtrace) +_XTRACE_NEUTRON_BIGSWITCH=$(set +o | grep xtrace) set +o xtrace BS_FL_CONTROLLERS_PORT=${BS_FL_CONTROLLERS_PORT:-localhost:80} @@ -51,4 +51,4 @@ function check_bigswitch_floodlight { } # Restore xtrace -$BS3_XTRACE +$_XTRACE_NEUTRON_BIGSWITCH diff --git a/lib/nova b/lib/nova index ba05f53b87..e5712939fe 100644 --- a/lib/nova +++ b/lib/nova @@ -25,7 +25,7 @@ # - cleanup_nova # Save trace setting -XTRACE=$(set +o | grep xtrace) +_XTRACE_LIB_NOVA=$(set +o | grep xtrace) set +o xtrace @@ -958,7 +958,7 @@ function stop_nova { # Restore xtrace -$XTRACE +$_XTRACE_LIB_NOVA # Tell emacs to use shell-script-mode ## Local variables: diff --git a/lib/nova_plugins/functions-libvirt b/lib/nova_plugins/functions-libvirt index 045fc8b919..dae55c6eba 100644 --- a/lib/nova_plugins/functions-libvirt +++ b/lib/nova_plugins/functions-libvirt @@ -8,7 +8,7 @@ # ``STACK_USER`` has to be defined # Save trace setting -LV_XTRACE=$(set +o | grep xtrace) +_XTRACE_NOVA_FN_LIBVIRT=$(set +o | grep xtrace) set +o xtrace # Defaults @@ -134,7 +134,7 @@ EOF # Restore xtrace -$LV_XTRACE +$_XTRACE_NOVA_FN_LIBVIRT # Local variables: # mode: shell-script diff --git a/lib/nova_plugins/hypervisor-fake b/lib/nova_plugins/hypervisor-fake index 3180d91f0a..2434dce884 100644 --- a/lib/nova_plugins/hypervisor-fake +++ b/lib/nova_plugins/hypervisor-fake @@ -17,7 +17,7 @@ # cleanup_nova_hypervisor - remove transient data and cache # Save trace setting -MY_XTRACE=$(set +o | grep xtrace) +_XTRACE_VIRTFAKE=$(set +o | grep xtrace) set +o xtrace @@ -72,7 +72,7 @@ function stop_nova_hypervisor { # Restore xtrace -$MY_XTRACE +$_XTRACE_VIRTFAKE # Local variables: # mode: shell-script diff --git a/lib/nova_plugins/hypervisor-ironic b/lib/nova_plugins/hypervisor-ironic index b9e286d5b6..c6ed85d63e 100644 --- a/lib/nova_plugins/hypervisor-ironic +++ b/lib/nova_plugins/hypervisor-ironic @@ -17,7 +17,7 @@ # cleanup_nova_hypervisor - remove transient data and cache # Save trace setting -MY_XTRACE=$(set +o | grep xtrace) +_XTRACE_HYP_IRONIC=$(set +o | grep xtrace) set +o xtrace source $TOP_DIR/lib/nova_plugins/functions-libvirt @@ -81,7 +81,7 @@ function stop_nova_hypervisor { # Restore xtrace -$MY_XTRACE +$_XTRACE_HYP_IRONIC # Local variables: # mode: shell-script diff --git a/lib/nova_plugins/hypervisor-libvirt b/lib/nova_plugins/hypervisor-libvirt index c54a7166a0..8bbaa2133d 100644 --- a/lib/nova_plugins/hypervisor-libvirt +++ b/lib/nova_plugins/hypervisor-libvirt @@ -17,7 +17,7 @@ # cleanup_nova_hypervisor - remove transient data and cache # Save trace setting -MY_XTRACE=$(set +o | grep xtrace) +_XTRACE_NOVA_LIBVIRT=$(set +o | grep xtrace) set +o xtrace source $TOP_DIR/lib/nova_plugins/functions-libvirt @@ -105,7 +105,7 @@ function stop_nova_hypervisor { # Restore xtrace -$MY_XTRACE +$_XTRACE_NOVA_LIBVIRT # Local variables: # mode: shell-script diff --git a/lib/nova_plugins/hypervisor-openvz b/lib/nova_plugins/hypervisor-openvz index cce36b8d3f..58ab5c11ac 100644 --- a/lib/nova_plugins/hypervisor-openvz +++ b/lib/nova_plugins/hypervisor-openvz @@ -17,7 +17,7 @@ # cleanup_nova_hypervisor - remove transient data and cache # Save trace setting -MY_XTRACE=$(set +o | grep xtrace) +_XTRACE_OPENVZ=$(set +o | grep xtrace) set +o xtrace @@ -62,7 +62,7 @@ function stop_nova_hypervisor { # Restore xtrace -$MY_XTRACE +$_XTRACE_OPENVZ # Local variables: # mode: shell-script diff --git a/lib/nova_plugins/hypervisor-vsphere b/lib/nova_plugins/hypervisor-vsphere index 698f836bad..7c08bc945b 100644 --- a/lib/nova_plugins/hypervisor-vsphere +++ b/lib/nova_plugins/hypervisor-vsphere @@ -17,7 +17,7 @@ # cleanup_nova_hypervisor - remove transient data and cache # Save trace setting -MY_XTRACE=$(set +o | grep xtrace) +_XTRACE_NOVA_VSPHERE=$(set +o | grep xtrace) set +o xtrace @@ -64,7 +64,7 @@ function stop_nova_hypervisor { # Restore xtrace -$MY_XTRACE +$_XTRACE_NOVA_VSPHERE # Local variables: # mode: shell-script diff --git a/lib/nova_plugins/hypervisor-xenserver b/lib/nova_plugins/hypervisor-xenserver index e097990bd3..3eb9149bb4 100644 --- a/lib/nova_plugins/hypervisor-xenserver +++ b/lib/nova_plugins/hypervisor-xenserver @@ -17,7 +17,7 @@ # cleanup_nova_hypervisor - remove transient data and cache # Save trace setting -MY_XTRACE=$(set +o | grep xtrace) +_XTRACE_XENSERVER=$(set +o | grep xtrace) set +o xtrace @@ -111,7 +111,7 @@ function stop_nova_hypervisor { # Restore xtrace -$MY_XTRACE +$_XTRACE_XENSERVER # Local variables: # mode: shell-script diff --git a/lib/oslo b/lib/oslo index 56615faaa3..3d6fbb38c6 100644 --- a/lib/oslo +++ b/lib/oslo @@ -16,7 +16,7 @@ # - install_oslo # Save trace setting -XTRACE=$(set +o | grep xtrace) +_XTRACE_LIB_OSLO=$(set +o | grep xtrace) set +o xtrace @@ -95,7 +95,7 @@ function install_oslo { } # Restore xtrace -$XTRACE +$_XTRACE_LIB_OSLO # Tell emacs to use shell-script-mode ## Local variables: diff --git a/lib/rpc_backend b/lib/rpc_backend index 298dcb6e5f..3864adec32 100644 --- a/lib/rpc_backend +++ b/lib/rpc_backend @@ -21,7 +21,7 @@ # of this file which is a standard interface. # Save trace setting -XTRACE=$(set +o | grep xtrace) +_XTRACE_RPC_BACKEND=$(set +o | grep xtrace) set +o xtrace # Functions @@ -141,7 +141,7 @@ function rabbit_setuser { } # Restore xtrace -$XTRACE +$_XTRACE_RPC_BACKEND # Tell emacs to use shell-script-mode ## Local variables: diff --git a/lib/swift b/lib/swift index d7ccc24111..b596142ad2 100644 --- a/lib/swift +++ b/lib/swift @@ -24,7 +24,7 @@ # - _cleanup_swift_apache_wsgi # Save trace setting -XTRACE=$(set +o | grep xtrace) +_XTRACE_LIB_SWIFT=$(set +o | grep xtrace) set +o xtrace @@ -823,7 +823,7 @@ function swift_configure_tempurls { } # Restore xtrace -$XTRACE +$_XTRACE_LIB_SWIFT # Tell emacs to use shell-script-mode ## Local variables: diff --git a/lib/tempest b/lib/tempest index 76fd6cac74..85e0e7fa35 100644 --- a/lib/tempest +++ b/lib/tempest @@ -38,7 +38,7 @@ # - init_tempest # Save trace setting -XTRACE=$(set +o | grep xtrace) +_XTRACE_TEMPEST=$(set +o | grep xtrace) set +o xtrace @@ -649,7 +649,7 @@ function init_tempest { } # Restore xtrace -$XTRACE +$_XTRACE_TEMPEST # Tell emacs to use shell-script-mode ## Local variables: diff --git a/lib/template b/lib/template index 2703788af4..08d10bbf71 100644 --- a/lib/template +++ b/lib/template @@ -21,7 +21,7 @@ # - cleanup_XXXX # Save trace setting -XTRACE=$(set +o | grep xtrace) +_XTRACE_TEMPLATE=$(set +o | grep xtrace) set +o xtrace @@ -92,7 +92,7 @@ function stop_XXXX { } # Restore xtrace -$XTRACE +$_XTRACE_TEMPLATE # Tell emacs to use shell-script-mode ## Local variables: diff --git a/stack.sh b/stack.sh index 8625b5aaeb..19d05c904a 100755 --- a/stack.sh +++ b/stack.sh @@ -573,7 +573,8 @@ run_phase source # Generic helper to configure passwords function read_password { - XTRACE=$(set +o | grep xtrace) + local xtrace + xtrace=$(set +o | grep xtrace) set +o xtrace var=$1; msg=$2 pw=${!var} @@ -616,7 +617,9 @@ function read_password { eval "$var=$pw" echo "$var=$pw" >> $localrc fi - $XTRACE + + # restore previous xtrace value + $xtrace }