Skip to content

Commit 629917a

Browse files
committed
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
1 parent 0a2a7ae commit 629917a

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

lib/neutron-legacy

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1453,9 +1453,13 @@ function delete_probe {
14531453
function setup_neutron_debug {
14541454
if [[ "$Q_USE_DEBUG_COMMAND" == "True" ]]; then
14551455
public_net_id=`_get_net_id $PUBLIC_NETWORK_NAME`
1456-
neutron-debug --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD probe-create --device-owner compute $public_net_id
1456+
if [[ -n $public_net_id ]]; then
1457+
neutron-debug --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD probe-create --device-owner compute $public_net_id
1458+
fi
14571459
private_net_id=`_get_net_id $PRIVATE_NETWORK_NAME`
1458-
neutron-debug --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD probe-create --device-owner compute $private_net_id
1460+
if [[ -n $private_net_id ]]; then
1461+
neutron-debug --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD probe-create --device-owner compute $private_net_id
1462+
fi
14591463
fi
14601464
}
14611465

0 commit comments

Comments
 (0)