From 629917a5dd0f5b56349294e0edc8b5bdd766aa46 Mon Sep 17 00:00:00 2001 From: Brad Behle Date: Tue, 22 Mar 2016 14:27:32 -0500 Subject: [PATCH] Check for valid network before probe-create call Check that a public and/or private network exists before calling probe-create for it, to avoid an error in the case where that network hasn't been created Change-Id: If01cec47dc4ab02b5d78074b1354df10dc23b384 Closes-bug: #1560629 --- lib/neutron-legacy | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/neutron-legacy b/lib/neutron-legacy index e06a020f43..34f9840791 100644 --- a/lib/neutron-legacy +++ b/lib/neutron-legacy @@ -1453,9 +1453,13 @@ function delete_probe { function setup_neutron_debug { if [[ "$Q_USE_DEBUG_COMMAND" == "True" ]]; then public_net_id=`_get_net_id $PUBLIC_NETWORK_NAME` - neutron-debug --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD probe-create --device-owner compute $public_net_id + if [[ -n $public_net_id ]]; then + neutron-debug --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD probe-create --device-owner compute $public_net_id + fi private_net_id=`_get_net_id $PRIVATE_NETWORK_NAME` - neutron-debug --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD probe-create --device-owner compute $private_net_id + if [[ -n $private_net_id ]]; then + neutron-debug --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD probe-create --device-owner compute $private_net_id + fi fi }