Remove usage of neutron-debug since it has been removed

The neutron-debug command was deprecated and finally removed,
so tools/ping_neutron.sh can no longer rely on it to create
a probe namespace. Instead, just try and use any namespace
with the network ID in it, since it's either the DHCP (ML2/OVS)
or Metadata (OVN) namespace, which should work just as well.
As this code is rarely (never?) used, this best-effort attempt
is good enough.
Change-Id: I98c992a2a774ef1fb22cee2e90ee342ab2d537ac
Depends-on: https://review.opendev.org/c/openstack/neutron/+/883081 
This commit is contained in:
Brian Haley
2023年05月12日 16:34:08 -04:00
parent 34afa91fc9
commit 6764eab264

View File

@@ -1112,24 +1112,6 @@ function _neutron_setup_interface_driver {
# Functions for Neutron Exercises
#--------------------------------
function delete_probe {
local from_net="1ドル"
net_id=`_get_net_id $from_net`
probe_id=`neutron-debug --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD probe-list -c id -c network_id | grep $net_id | awk '{print 2ドル}'`
neutron-debug --os-tenant-name admin --os-username admin probe-delete $probe_id
}
function _get_net_id {
openstack --os-cloud devstack-admin --os-region-name="$REGION_NAME" --os-project-name admin --os-username admin --os-password $ADMIN_PASSWORD network list | grep 1ドル | awk '{print 2ドル}'
}
function _get_probe_cmd_prefix {
local from_net="1ドル"
net_id=`_get_net_id $from_net`
probe_id=`neutron-debug --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD probe-list -c id -c network_id | grep $net_id | awk '{print 2ドル}' | head -n 1`
echo "$Q_RR_COMMAND ip netns exec qprobe-$probe_id"
}
# ssh check
function _ssh_check_neutron {
local from_net=1ドル

View File

@@ -30,7 +30,8 @@ ping_neutron.sh <net_name> [ping args]
This provides a wrapper to ping neutron guests that are on isolated
tenant networks that the caller can't normally reach. It does so by
creating a network namespace probe.
using either the DHCP or Metadata network namespace to support both
ML2/OVS and OVN.
It takes arguments like ping, except the first arg must be the network
name.
@@ -44,6 +45,12 @@ EOF
exit 1
}
# BUG: with duplicate network names, this fails pretty hard since it
# will just pick the first match.
function _get_net_id {
openstack --os-cloud devstack-admin --os-region-name="$REGION_NAME" --os-project-name admin --os-username admin --os-password $ADMIN_PASSWORD network list | grep 1ドル | head -n 1 | awk '{print 2ドル}'
}
NET_NAME=1ドル
if [[ -z "$NET_NAME" ]]; then
@@ -53,12 +60,11 @@ fi
REMAINING_ARGS="${@:2}"
# BUG: with duplicate network names, this fails pretty hard.
NET_ID=$(openstack network show -f value -c id "$NET_NAME")
PROBE_ID=$(neutron-debug probe-list -c id -c network_id | grep "$NET_ID" | awk '{print 2ドル}' | head -n 1)
NET_ID=`_get_net_id $NET_NAME`
NET_NS=$(ip netns list | grep "$NET_ID" | head -n 1)
# This runs a command inside the specific netns
NET_NS_CMD="ip netns exec qprobe-$PROBE_ID"
NET_NS_CMD="ip netns exec $NET_NS"
PING_CMD="sudo $NET_NS_CMD ping $REMAINING_ARGS"
echo "Running $PING_CMD"
Reference in New Issue
openstack/devstack
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.

The note is not visible to the blocked user.