Fix multinode gate after switch to Python 3

The compute1 node of multinode gate was not explicitly set to use Python
3 and failed after Nova dropped support for it. This commit fixes that.

Change-Id: I2f0376091af67bb79dcef51974d11e7a40bb0e4c
This commit is contained in:
Michał Dulko 2019-11-19 14:47:00 +01:00
parent 28b27c5de2
commit 3eba2d3bcd
3 changed files with 13 additions and 12 deletions

View File

@ -17,7 +17,7 @@
parent: kuryr-kubernetes-tempest
description: |
Kuryr-Kubernetes tempest multinode job
nodeset: openstack-two-node
nodeset: openstack-two-node-bionic
host-vars:
controller:
devstack_plugins:
@ -43,6 +43,7 @@
devstack_localrc:
KURYR_FORCE_IMAGE_BUILD: true
KURYR_K8S_CONTAINERIZED_DEPLOYMENT: true
USE_PYTHON3: true
vars:
devstack_localrc:
KURYR_K8S_CONTAINERIZED_DEPLOYMENT: true

View File

@ -59,8 +59,8 @@ function ovs_bind_for_kubelet() {
port_mac=$(openstack port show "$port_id" -c mac_address -f value)
fixed_ips=$(openstack port show "$port_id" -f value -c fixed_ips)
port_ips=($(python -c "print ${fixed_ips}[0]['ip_address']"))
port_subnets=($(python -c "print ${fixed_ips}[0]['subnet_id']"))
port_ips=($(python3 -c "print(${fixed_ips}[0]['ip_address'])"))
port_subnets=($(python3 -c "print(${fixed_ips}[0]['subnet_id'])"))
sudo ovs-vsctl -- --may-exist add-port $OVS_BRIDGE "$ifname" \
-- set Interface "$ifname" type=internal \
@ -79,7 +79,7 @@ function ovs_bind_for_kubelet() {
if [[ "$KURYR_SUBNET_DRIVER" == "namespace" ]]; then
subnetpool_id=${KURYR_NEUTRON_DEFAULT_SUBNETPOOL_ID:-${SUBNETPOOL_V4_ID}}
cidrs=$(openstack subnet pool show "${subnetpool_id}" -c prefixes -f value)
subnetpool_cidr=$(python -c "print ${cidrs}[0]")
subnetpool_cidr=$(python3 -c "print(${cidrs}[0])")
sudo ip route add "$subnetpool_cidr" via "$pod_subnet_gw" dev "$ifname"
else
sudo ip route add "$service_subnet_cidr" via "$pod_subnet_gw" dev "$ifname"
@ -160,7 +160,7 @@ function stop_container {
# cidr - The cidr to get the range for
# gateway_position - Whether to reserve at 'beginning' or at 'end'
function _allocation_range {
python - <<EOF "$@"
python3 - <<EOF "$@"
import sys
from netaddr import IPNetwork
@ -1020,7 +1020,7 @@ function create_load_balancer_member {
# Returns: tab separated CIDRs of the two halves.
function split_subnet {
# precondition: The passed cidr must be of a prefix <= 30
python - <<EOF "$@"
python3 - <<EOF "$@"
import sys
from netaddr import IPNetwork
@ -1064,7 +1064,7 @@ function openshift_node_set_dns_config {
nameserver $upstream_dns_ip
EOF
python - <<EOF "$@"
python3 - <<EOF "$@"
import os
import sys
import tempfile
@ -1222,7 +1222,7 @@ function run_openshift_registry {
--tls-key=${OPENSHIFT_DATA_DIR}/master/registry.key \
-o yaml > $registry_yaml
python - <<EOF "$registry_yaml" "$registry_ip"
python3 - <<EOF "$registry_yaml" "$registry_ip"
import copy
import os
import sys
@ -1315,7 +1315,7 @@ function _nth_cidr_ip {
cidr="$1"
position="$2"
python - <<EOF "$cidr" "$position"
python3 - <<EOF "$cidr" "$position"
import sys
from netaddr import IPAddress, IPNetwork

View File

@ -188,7 +188,7 @@ function install_kuryr_cni {
}
function _cidr_range {
python - <<EOF "$1"
python3 - <<EOF "$1"
import sys
from netaddr import IPAddress, IPNetwork
n = IPNetwork(sys.argv[1])
@ -232,7 +232,7 @@ function create_k8s_api_service {
-c cidr -f value)
fixed_ips=$(openstack port show kubelet-"${HOSTNAME}" -c fixed_ips -f value)
kubelet_iface_ip=$(python -c "print ${fixed_ips}[0]['ip_address']")
kubelet_iface_ip=$(python3 -c "print(${fixed_ips}[0]['ip_address'])")
k8s_api_clusterip=$(_cidr_range "$service_cidr" | cut -f1)
@ -893,7 +893,7 @@ EOF
function run_kuryr_kubernetes {
local python_bin=$(which python)
local python_bin=$(which python3)
if is_service_enabled openshift-master; then
wait_for "OpenShift API Server" "${KURYR_K8S_API_ROOT}" \