summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCrank, Daniel (dc6350) <dc6350@att.com>2018-10-11 09:03:46 -0500
committerCrank, Daniel (dc6350) <dc6350@att.com>2018-10-11 09:03:46 -0500
commit56521ab77c746b8e7de129160f8859e31bee9a3a (patch)
treeddcbed7de6a8f489ab3929aa6a6263eb16fc15d3
parent8cbbc1015abf8a688e85c1314982a9cade35bd61 (diff)
[470918] Update MaaS to 2.3.5
Updating MaaS to 2.3.5, as 2.3.0 appears to no longer be available in the Ubuntu repo. Change-Id: I5afb38d8e73485be1ab05a9ac2a18e1befe70152
Notes
Notes (review): Code-Review+2: Scott Hussey <sthussey@att.com> Code-Review+1: Dan Crank <dan.no@att.com> Code-Review+2: Pete Birley <petebirley@gmail.com> Workflow+1: Pete Birley <petebirley@gmail.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Tue, 16 Oct 2018 16:55:49 +0000 Reviewed-on: https://review.openstack.org/609717 Project: openstack/airship-maas Branch: refs/heads/master
-rw-r--r--images/maas-rack-controller/2.3_nic_filter.patch4
-rw-r--r--images/maas-rack-controller/Dockerfile3
-rw-r--r--images/maas-region-controller/2.3_nat_fix.patch18
-rw-r--r--images/maas-region-controller/2.3_proxy_port.patch20
-rw-r--r--images/maas-region-controller/2.3_recursion_fix.patch63
-rw-r--r--images/maas-region-controller/2.3_route.patch21
-rw-r--r--images/maas-region-controller/Dockerfile6
7 files changed, 19 insertions, 116 deletions
diff --git a/images/maas-rack-controller/2.3_nic_filter.patch b/images/maas-rack-controller/2.3_nic_filter.patch
index 23ca783..cd6e710 100644
--- a/images/maas-rack-controller/2.3_nic_filter.patch
+++ b/images/maas-rack-controller/2.3_nic_filter.patch
@@ -1,8 +1,8 @@
1diff --git a/src/provisioningserver/utils/network.py b/src/provisioningserver/utils/network.py 1diff --git a/src/provisioningserver/utils/network.py b/src/provisioningserver/utils/network.py
2index 48eb8fd..41d13a0 100644 2index 960d3eb..cd627fd 100644
3--- a/src/provisioningserver/utils/network.py 3--- a/src/provisioningserver/utils/network.py
4+++ b/src/provisioningserver/utils/network.py 4+++ b/src/provisioningserver/utils/network.py
5@@ -1141,7 +1141,7 @@ def get_all_interfaces_definition(annotate_with_monitored: bool=True) -> dict: 5@@ -1138,7 +1138,7 @@ def get_all_interfaces_definition(annotate_with_monitored: bool=True) -> dict:
6 interfaces = {} 6 interfaces = {}
7 dhclient_info = get_dhclient_info() 7 dhclient_info = get_dhclient_info()
8 iproute_info = get_ip_route() 8 iproute_info = get_ip_route()
diff --git a/images/maas-rack-controller/Dockerfile b/images/maas-rack-controller/Dockerfile
index c808df4..0b9b7f4 100644
--- a/images/maas-rack-controller/Dockerfile
+++ b/images/maas-rack-controller/Dockerfile
@@ -29,7 +29,7 @@ RUN systemctl set-default multi-user.target
29RUN apt-get install -y rsyslog 29RUN apt-get install -y rsyslog
30RUN systemctl enable rsyslog.service 30RUN systemctl enable rsyslog.service
31 31
32ENV MAAS_VERSION 2.3.0-6434-gd354690-0ubuntu1~16.04.1 32ENV MAAS_VERSION 2.3.5-6511-gf466fdb-0ubuntu1
33 33
34# install maas 34# install maas
35RUN rsyslogd; apt-get install -y maas-cli=$MAAS_VERSION maas-rack-controller=$MAAS_VERSION 35RUN rsyslogd; apt-get install -y maas-cli=$MAAS_VERSION maas-rack-controller=$MAAS_VERSION
@@ -45,6 +45,7 @@ RUN mv /usr/sbin/tcpdump /usr/bin/tcpdump
45RUN ln -s /usr/bin/tcpdump /usr/sbin/tcpdump 45RUN ln -s /usr/bin/tcpdump /usr/sbin/tcpdump
46 46
47# Patch so that Calico interfaces are ignored 47# Patch so that Calico interfaces are ignored
48# dc6350: this appears to be fixed in maas master as of 10/4/2018, but that change is not in 2.3.5
48COPY 2.3_nic_filter.patch /tmp/2.3_nic_filter.patch 49COPY 2.3_nic_filter.patch /tmp/2.3_nic_filter.patch
49RUN cd /usr/lib/python3/dist-packages/provisioningserver/utils && patch network.py < /tmp/2.3_nic_filter.patch 50RUN cd /usr/lib/python3/dist-packages/provisioningserver/utils && patch network.py < /tmp/2.3_nic_filter.patch
50 51
diff --git a/images/maas-region-controller/2.3_nat_fix.patch b/images/maas-region-controller/2.3_nat_fix.patch
deleted file mode 100644
index b07d48c..0000000
--- a/images/maas-region-controller/2.3_nat_fix.patch
+++ /dev/null
@@ -1,18 +0,0 @@
1diff --git a/src/maasserver/utils/__init__.py b/src/maasserver/utils/__init__.py
2index 1c58859..f8e673d 100644
3--- a/src/maasserver/utils/__init__.py
4+++ b/src/maasserver/utils/__init__.py
5@@ -66,8 +66,11 @@ def absolute_reverse(
6 if not base_url:
7 with RegionConfiguration.open() as config:
8 base_url = config.maas_url
9- if default_region_ip is not None:
10- base_url = compose_URL(base_url, default_region_ip)
11+ # NOTE(sh8121att)
12+ # Commenting out as workaround to
13+ # https://bugs.launchpad.net/maas/+bug/1743005
14+ #if default_region_ip is not None:
15+ # base_url = compose_URL(base_url, default_region_ip)
16 url = urljoin(base_url, reverse(view_name, *args, **kwargs))
17 if query is not None:
18 url += '?%s' % urlencode(query, doseq=True)
diff --git a/images/maas-region-controller/2.3_proxy_port.patch b/images/maas-region-controller/2.3_proxy_port.patch
index b28e95f..89f98b7 100644
--- a/images/maas-region-controller/2.3_proxy_port.patch
+++ b/images/maas-region-controller/2.3_proxy_port.patch
@@ -1,14 +1,14 @@
1diff --git a/src/maasserver/compose_preseed.py b/src/maasserver/compose_preseed.py 1diff --git a/src/maasserver/compose_preseed.py b/src/maasserver/compose_preseed.py
2index e15b3b2..b7c7edc 100644 2index f24b10f..f030469 100644
3--- a/src/maasserver/compose_preseed.py 3--- a/src/maasserver/compose_preseed.py
4+++ b/src/maasserver/compose_preseed.py 4+++ b/src/maasserver/compose_preseed.py
5@@ -8,7 +8,7 @@ __all__ = [ 5@@ -8,7 +8,7 @@ __all__ = [
6 ] 6 ]
7 7
8 from datetime import timedelta 8 from datetime import timedelta
9-from urllib.parse import urlencode 9-from urllib.parse import urlencode
10+from urllib.parse import urlencode, urlparse 10+from urllib.parse import urlencode, urlparse
11 11
12 from maasserver.clusterrpc.osystems import get_preseed_data 12 from maasserver.clusterrpc.osystems import get_preseed_data
13 from maasserver.enum import ( 13 from maasserver.enum import (
14@@ -17,6 +17,7 @@ from maasserver.enum import ( 14@@ -17,6 +17,7 @@ from maasserver.enum import (
@@ -19,16 +19,18 @@ index e15b3b2..b7c7edc 100644
19 from maasserver.models.config import Config 19 from maasserver.models.config import Config
20 from maasserver.server_address import get_maas_facing_server_host 20 from maasserver.server_address import get_maas_facing_server_host
21 from maasserver.utils import absolute_reverse 21 from maasserver.utils import absolute_reverse
22@@ -41,9 +42,9 @@ def get_apt_proxy(rack_controller=None, default_region_ip=None): 22@@ -43,11 +44,11 @@ def get_apt_proxy(rack_controller=None, default_region_ip=None):
23 if http_proxy and not use_peer_proxy:
24 return http_proxy
25 else: 23 else:
24 maas_proxy_port = Config.objects.get_config("maas_proxy_port")
25 if not maas_proxy_port:
26- maas_proxy_port = 8000
27+ maas_proxy_port = 31800
28 url = "http://:%d/" % maas_proxy_port
26- return compose_URL( 29- return compose_URL(
27- "http://:8000/", get_maas_facing_server_host( 30- url, get_maas_facing_server_host(
28- rack_controller, default_region_ip=default_region_ip)) 31- rack_controller, default_region_ip=default_region_ip))
29+ with RegionConfiguration.open() as config: 32+ with RegionConfiguration.open() as config:
30+ maas_url = config.maas_url 33+ maas_url = config.maas_url
31+ return compose_URL("http://:31800/", urlparse(maas_url).hostname) 34+ return compose_URL(url, urlparse(maas_url).hostname)
32 else: 35 else:
33 return None 36 return None
34
diff --git a/images/maas-region-controller/2.3_recursion_fix.patch b/images/maas-region-controller/2.3_recursion_fix.patch
deleted file mode 100644
index d7ab647..0000000
--- a/images/maas-region-controller/2.3_recursion_fix.patch
+++ /dev/null
@@ -1,63 +0,0 @@
1=== modified file 'src/maasserver/models/signals/interfaces.py'
2--- src/maasserver/models/signals/interfaces.py 2016-07-30 01:17:54 +0000
3+++ src/maasserver/models/signals/interfaces.py 2016-09-10 07:09:35 +0000
4@@ -45,6 +45,28 @@
5 signals = SignalsManager()
6
7
8+class InterfaceVisitingThreadLocal(threading.local):
9+ """Since infinite recursion could occur in an arbitrary interface
10+ hierarchy, use thread-local storage to ensure that each interface is only
11+ visited once.
12+ """
13+ def __init__(self):
14+ super().__init__()
15+ self.visiting = set()
16+
17+enabled_or_disabled_thread_local = InterfaceVisitingThreadLocal()
18+
19+
20+def ensure_link_up(interface):
21+ visiting = enabled_or_disabled_thread_local.visiting
22+ if interface.id not in visiting:
23+ try:
24+ visiting.add(interface.id)
25+ interface.ensure_link_up()
26+ finally:
27+ visiting.discard(interface.id)
28+
29+
30 def interface_enabled_or_disabled(instance, old_values, **kwargs):
31 """When an interface is enabled be sure at minimum a LINK_UP is created.
32 When an interface is disabled make sure that all its links are removed,
33@@ -53,9 +75,10 @@
34 return
35 if instance.is_enabled():
36 # Make sure it has a LINK_UP link, and for its children.
37- instance.ensure_link_up()
38+ ensure_link_up(instance)
39 for rel in instance.children_relationships.all():
40- rel.child.ensure_link_up()
41+ ensure_link_up(rel.child)
42+
43 else:
44 # Was disabled. Remove the links.
45 for ip_address in instance.ip_addresses.exclude(
46@@ -140,16 +163,7 @@
47 klass, ['params'], delete=False)
48
49
50-class InterfaceUpdateParentsThreadLocal(threading.local):
51- """Since infinite recursion could occur in an arbitrary interface
52- hierarchy, use thread-local stroage to ensure that each interface is only
53- visited once.
54- """
55- def __init__(self):
56- super().__init__()
57- self.visiting = set()
58-
59-update_parents_thread_local = InterfaceUpdateParentsThreadLocal()
60+update_parents_thread_local = InterfaceVisitingThreadLocal()
61
62
63 def update_interface_parents(sender, instance, created, **kwargs):
diff --git a/images/maas-region-controller/2.3_route.patch b/images/maas-region-controller/2.3_route.patch
index 46bc9cc..f5e9765 100644
--- a/images/maas-region-controller/2.3_route.patch
+++ b/images/maas-region-controller/2.3_route.patch
@@ -1,28 +1,13 @@
1diff --git a/src/maasserver/preseed_network.py b/src/maasserver/preseed_network.py 1diff --git a/src/maasserver/preseed_network.py b/src/maasserver/preseed_network.py
2index 1be72d6..96ee6a3 100644 2index bb56765..1185ff1 100644
3--- a/src/maasserver/preseed_network.py 3--- a/src/maasserver/preseed_network.py
4+++ b/src/maasserver/preseed_network.py 4+++ b/src/maasserver/preseed_network.py
5@@ -192,7 +192,7 @@ class InterfaceConfiguration: 5@@ -203,7 +203,7 @@ class InterfaceConfiguration:
6 return { 6 return {
7 route 7 route
8 for route in self.routes 8 for route in self.routes
9- if route.source == source 9- if route.source == source
10+ if str(route.source.cidr) == str(source.cidr) 10+ if str(route.source.cidr) == str(source.cidr)
11 } 11 }
12 12
13 def _generate_addresses(self, version=1): 13 def _generate_addresses(self, version=1):
14@@ -251,8 +251,12 @@ class InterfaceConfiguration:
15 v2_nameservers["addresses"] = []
16 v2_nameservers["addresses"].extend(
17 [server for server in subnet.dns_servers])
18- self.matching_routes.update(
19- self._get_matching_routes(subnet))
20+ net_routes = self._get_matching_routes(subnet)
21+ rl = [_generate_route_operation(r, version=version)
22+ for r
23+ in net_routes]
24+ v1_subnet_operation['routes'] = rl
25+ v2_config['routes'] = rl
26 if dhcp_type:
27 v1_config.append(
28 {"type": dhcp_type}
diff --git a/images/maas-region-controller/Dockerfile b/images/maas-region-controller/Dockerfile
index 4e99704..ca9e078 100644
--- a/images/maas-region-controller/Dockerfile
+++ b/images/maas-region-controller/Dockerfile
@@ -30,7 +30,7 @@ RUN apt-get install -y systemd
30RUN apt-get install -y rsyslog 30RUN apt-get install -y rsyslog
31RUN systemctl enable rsyslog.service 31RUN systemctl enable rsyslog.service
32 32
33ENV MAAS_VERSION 2.3.0-6434-gd354690-0ubuntu1~16.04.1 33ENV MAAS_VERSION 2.3.5-6511-gf466fdb-0ubuntu1
34 34
35# install maas 35# install maas
36RUN rsyslogd; apt-get install -y maas-cli=$MAAS_VERSION \ 36RUN rsyslogd; apt-get install -y maas-cli=$MAAS_VERSION \
@@ -54,14 +54,10 @@ RUN apt-get download maas-region-controller=$MAAS_VERSION && \
54 pg_dropcluster --stop 9.5 main 54 pg_dropcluster --stop 9.5 main
55 55
56# 2.3 workarounds 56# 2.3 workarounds
57COPY 2.3_nat_fix.patch /tmp/2.3_nat_fix.patch
58COPY 2.3_proxy_port.patch /tmp/2.3_proxy_port.patch 57COPY 2.3_proxy_port.patch /tmp/2.3_proxy_port.patch
59COPY 2.3_route.patch /tmp/2.3_route.patch 58COPY 2.3_route.patch /tmp/2.3_route.patch
60COPY 2.3_recursion_fix.patch /tmp/2.3_recursion_fix.patch
61RUN cd /usr/lib/python3/dist-packages/maasserver/utils && patch __init__.py < /tmp/2.3_nat_fix.patch
62RUN cd /usr/lib/python3/dist-packages/maasserver && patch compose_preseed.py < /tmp/2.3_proxy_port.patch 59RUN cd /usr/lib/python3/dist-packages/maasserver && patch compose_preseed.py < /tmp/2.3_proxy_port.patch
63RUN cd /usr/lib/python3/dist-packages/maasserver && patch preseed_network.py < /tmp/2.3_route.patch 60RUN cd /usr/lib/python3/dist-packages/maasserver && patch preseed_network.py < /tmp/2.3_route.patch
64RUN cd /usr/lib/python3/dist-packages/maasserver/models/signals && patch interfaces.py < /tmp/2.3_recursion_fix.patch
65 61
66COPY journalctl-to-tty.service /etc/systemd/system/journalctl-to-tty.service 62COPY journalctl-to-tty.service /etc/systemd/system/journalctl-to-tty.service
67RUN mkdir -p /etc/systemd/system/basic.target.wants ;\ 63RUN mkdir -p /etc/systemd/system/basic.target.wants ;\