Browse Source

[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
Crank, Daniel (dc6350) 6 months ago
parent
commit
56521ab77c

+ 2
- 2
images/maas-rack-controller/2.3_nic_filter.patch View File

@@ -1,8 +1,8 @@
1 1
 diff --git a/src/provisioningserver/utils/network.py b/src/provisioningserver/utils/network.py
2
-index 48eb8fd..41d13a0 100644
2
+index 960d3eb..cd627fd 100644
3 3
 --- a/src/provisioningserver/utils/network.py
4 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 6
      interfaces = {}
7 7
      dhclient_info = get_dhclient_info()
8 8
      iproute_info = get_ip_route()

+ 2
- 1
images/maas-rack-controller/Dockerfile View File

@@ -29,7 +29,7 @@ RUN systemctl set-default multi-user.target
29 29
 RUN apt-get install -y rsyslog
30 30
 RUN systemctl enable rsyslog.service
31 31
 
32
-ENV MAAS_VERSION 2.3.0-6434-gd354690-0ubuntu1~16.04.1
32
+ENV MAAS_VERSION 2.3.5-6511-gf466fdb-0ubuntu1
33 33
 
34 34
 # install maas
35 35
 RUN 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
45 45
 RUN ln -s /usr/bin/tcpdump /usr/sbin/tcpdump
46 46
 
47 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
48 49
 COPY 2.3_nic_filter.patch /tmp/2.3_nic_filter.patch
49 50
 RUN cd /usr/lib/python3/dist-packages/provisioningserver/utils && patch network.py < /tmp/2.3_nic_filter.patch
50 51
 

+ 0
- 18
images/maas-region-controller/2.3_nat_fix.patch View File

@@ -1,18 +0,0 @@
1
-diff --git a/src/maasserver/utils/__init__.py b/src/maasserver/utils/__init__.py
2
-index 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)

+ 11
- 9
images/maas-region-controller/2.3_proxy_port.patch View File

@@ -1,14 +1,14 @@
1 1
 diff --git a/src/maasserver/compose_preseed.py b/src/maasserver/compose_preseed.py
2
-index e15b3b2..b7c7edc 100644
2
+index f24b10f..f030469 100644
3 3
 --- a/src/maasserver/compose_preseed.py
4 4
 +++ b/src/maasserver/compose_preseed.py
5 5
 @@ -8,7 +8,7 @@ __all__ = [
6 6
      ]
7
- 
7
+
8 8
  from datetime import timedelta
9 9
 -from urllib.parse import urlencode
10 10
 +from urllib.parse import urlencode, urlparse
11
- 
11
+
12 12
  from maasserver.clusterrpc.osystems import get_preseed_data
13 13
  from maasserver.enum import (
14 14
 @@ -17,6 +17,7 @@ from maasserver.enum import (
@@ -19,16 +19,18 @@ index e15b3b2..b7c7edc 100644
19 19
  from maasserver.models.config import Config
20 20
  from maasserver.server_address import get_maas_facing_server_host
21 21
  from maasserver.utils import absolute_reverse
22
-@@ -41,9 +42,9 @@ def get_apt_proxy(rack_controller=None, default_region_ip=None):
23
-         if http_proxy and not use_peer_proxy:
24
-             return http_proxy
22
+@@ -43,11 +44,11 @@ def get_apt_proxy(rack_controller=None, default_region_ip=None):
25 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 29
 -            return compose_URL(
27
--                "http://:8000/", get_maas_facing_server_host(
30
+-                url, get_maas_facing_server_host(
28 31
 -                    rack_controller, default_region_ip=default_region_ip))
29 32
 +            with RegionConfiguration.open() as config:
30 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 35
      else:
33 36
          return None
34
- 

+ 0
- 63
images/maas-region-controller/2.3_recursion_fix.patch View File

@@ -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):

+ 3
- 18
images/maas-region-controller/2.3_route.patch View File

@@ -1,28 +1,13 @@
1 1
 diff --git a/src/maasserver/preseed_network.py b/src/maasserver/preseed_network.py
2
-index 1be72d6..96ee6a3 100644
2
+index bb56765..1185ff1 100644
3 3
 --- a/src/maasserver/preseed_network.py
4 4
 +++ b/src/maasserver/preseed_network.py
5
-@@ -192,7 +192,7 @@ class InterfaceConfiguration:
5
+@@ -203,7 +203,7 @@ class InterfaceConfiguration:
6 6
          return {
7 7
              route
8 8
              for route in self.routes
9 9
 -            if route.source == source
10 10
 +            if str(route.source.cidr) == str(source.cidr)
11 11
          }
12
- 
12
+
13 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}

+ 1
- 5
images/maas-region-controller/Dockerfile View File

@@ -30,7 +30,7 @@ RUN apt-get install -y systemd
30 30
 RUN apt-get install -y rsyslog
31 31
 RUN systemctl enable rsyslog.service
32 32
 
33
-ENV MAAS_VERSION 2.3.0-6434-gd354690-0ubuntu1~16.04.1
33
+ENV MAAS_VERSION 2.3.5-6511-gf466fdb-0ubuntu1
34 34
 
35 35
 # install maas
36 36
 RUN rsyslogd; apt-get install -y maas-cli=$MAAS_VERSION \
@@ -54,14 +54,10 @@ RUN apt-get download maas-region-controller=$MAAS_VERSION && \
54 54
     pg_dropcluster --stop 9.5 main
55 55
 
56 56
 # 2.3 workarounds
57
-COPY 2.3_nat_fix.patch /tmp/2.3_nat_fix.patch
58 57
 COPY 2.3_proxy_port.patch /tmp/2.3_proxy_port.patch
59 58
 COPY 2.3_route.patch /tmp/2.3_route.patch
60
-COPY 2.3_recursion_fix.patch /tmp/2.3_recursion_fix.patch
61
-RUN cd /usr/lib/python3/dist-packages/maasserver/utils && patch __init__.py < /tmp/2.3_nat_fix.patch
62 59
 RUN cd /usr/lib/python3/dist-packages/maasserver && patch compose_preseed.py < /tmp/2.3_proxy_port.patch
63 60
 RUN cd /usr/lib/python3/dist-packages/maasserver && patch preseed_network.py < /tmp/2.3_route.patch
64
-RUN cd /usr/lib/python3/dist-packages/maasserver/models/signals && patch interfaces.py < /tmp/2.3_recursion_fix.patch
65 61
 
66 62
 COPY journalctl-to-tty.service /etc/systemd/system/journalctl-to-tty.service
67 63
 RUN mkdir -p /etc/systemd/system/basic.target.wants ;\

Loading…
Cancel
Save