Browse Source

Fix py3 gate

Netaddr library is supported in py2 and py3. We should be using it
instead of relying on ipaddress, which is only supported in py3.

Also in order to unblock the gate this makes sure stable
upper-constraints are used in container builds.

Co-Authored-By: Michał Dulko <mdulko@redhat.com>
Change-Id: I93ee6343a66de1adcaca800e0614da72a4df60d9
(cherry picked from commit 971b2ee3bf)
changes/72/705972/2
Maysa Macedo Michał Dulko 3 months ago
parent
commit
afac4f2577
5 changed files with 9 additions and 9 deletions
  1. +1
    -1
      cni.Dockerfile
  2. +1
    -1
      cni_py3.Dockerfile
  3. +1
    -1
      controller.Dockerfile
  4. +1
    -1
      controller_py3.Dockerfile
  5. +5
    -5
      devstack/lib/kuryr_kubernetes

+ 1
- 1
cni.Dockerfile View File

@@ -7,7 +7,7 @@ RUN go build -o /go/bin/kuryr-cni ./kuryr_cni
FROM centos:7
LABEL authors="Antoni Segura Puimedon<toni@kuryr.org>, Michał Dulko<mdulko@redhat.com>"

ARG UPPER_CONSTRAINTS_FILE="https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt"
ARG UPPER_CONSTRAINTS_FILE="https://releases.openstack.org/constraints/upper/train"
ARG OSLO_LOCK_PATH=/var/kuryr-lock

RUN yum install -y epel-release https://rdoproject.org/repos/rdo-release.rpm \


+ 1
- 1
cni_py3.Dockerfile View File

@@ -7,7 +7,7 @@ RUN go build -o /go/bin/kuryr-cni ./kuryr_cni
FROM fedora:30
LABEL authors="Antoni Segura Puimedon<toni@kuryr.org>, Michał Dulko<mdulko@redhat.com>"

ARG UPPER_CONSTRAINTS_FILE="https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt"
ARG UPPER_CONSTRAINTS_FILE="https://releases.openstack.org/constraints/upper/train"
ARG OSLO_LOCK_PATH=/var/kuryr-lock

RUN dnf update -y \


+ 1
- 1
controller.Dockerfile View File

@@ -1,7 +1,7 @@
FROM centos:7
LABEL authors="Antoni Segura Puimedon<toni@kuryr.org>, Michał Dulko<mdulko@redhat.com>"

ARG UPPER_CONSTRAINTS_FILE="https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt"
ARG UPPER_CONSTRAINTS_FILE="https://releases.openstack.org/constraints/upper/train"

RUN yum install -y epel-release \
&& yum install -y --setopt=tsflags=nodocs python-pip libstdc++ \


+ 1
- 1
controller_py3.Dockerfile View File

@@ -1,7 +1,7 @@
FROM fedora:30
LABEL authors="Antoni Segura Puimedon<toni@kuryr.org>, Michał Dulko<mdulko@redhat.com>"

ARG UPPER_CONSTRAINTS_FILE="https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt"
ARG UPPER_CONSTRAINTS_FILE="https://releases.openstack.org/constraints/upper/train"

RUN dnf update -y \
&& dnf install -y --setopt=tsflags=nodocs python36 libstdc++ \


+ 5
- 5
devstack/lib/kuryr_kubernetes View File

@@ -163,11 +163,11 @@ function _allocation_range {
python - <<EOF "$@"
import sys

from ipaddress import ip_network
from netaddr import IPNetwork
import six


n = ip_network(six.text_type(sys.argv[1]))
n = IPNetwork(six.text_type(sys.argv[1]))
gateway_position = sys.argv[2]

if gateway_position == 'beginning':
@@ -1013,12 +1013,12 @@ function split_subnet {
python - <<EOF "$@"
import sys

from ipaddress import ip_network
from netaddr import IPNetwork
import six


n = ip_network(six.text_type(sys.argv[1]))
first, last = n.subnets(prefixlen_diff=1)
n = IPNetwork(six.text_type(sys.argv[1]))
first, last = n.subnet(n.prefixlen+1)

print("%s\\t%s" % (first, last))
EOF


Loading…
Cancel
Save