From owner-dev-commits-ports-all@freebsd.org Mon Jul 5 05:24:41 2021 Return-Path: Delivered-To: dev-commits-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D3561654160; Mon, 5 Jul 2021 05:24:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GJDdj4GjQz3pxn; Mon, 5 Jul 2021 05:24:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7811D202F5; Mon, 5 Jul 2021 05:24:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1655OfJl023632; Mon, 5 Jul 2021 05:24:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1655OfT6023631; Mon, 5 Jul 2021 05:24:41 GMT (envelope-from git) Date: Mon, 5 Jul 2021 05:24:41 GMT Message-Id: <202107050524.1655OfT6023631@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Li-Wen Hsu Subject: git: 9620aca55054 - main - net/cloud-init: Update to 21.2 and add patch for setting MTU MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9620aca55054d7f4e7fc85cd2f0e01ea984c237a Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Jul 2021 05:24:41 -0000 The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/ports/commit/?id=9620aca55054d7f4e7fc85cd2f0e01ea984c237a commit 9620aca55054d7f4e7fc85cd2f0e01ea984c237a Author: Andrey Fesenko AuthorDate: 2021-07-05 05:23:02 +0000 Commit: Li-Wen Hsu CommitDate: 2021-07-05 05:24:22 +0000 net/cloud-init: Update to 21.2 and add patch for setting MTU PR: 256309 --- net/cloud-init/Makefile | 3 +- net/cloud-init/distinfo | 6 +-- net/cloud-init/files/patch-cloudinit_net_bsd.py | 60 ++++++++++++++++++++++ .../files/patch-cloudinit_net_freebsd.py | 21 ++++++++ 4 files changed, 85 insertions(+), 5 deletions(-) diff --git a/net/cloud-init/Makefile b/net/cloud-init/Makefile index 753714cf70b0..e7f68e4ffb84 100644 --- a/net/cloud-init/Makefile +++ b/net/cloud-init/Makefile @@ -1,6 +1,5 @@ PORTNAME= cloud-init -DISTVERSION= 20.4.1 -PORTREVISION= 2 +DISTVERSION= 21.2 CATEGORIES= net python PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} diff --git a/net/cloud-init/distinfo b/net/cloud-init/distinfo index 72fe76f4583a..156ee69ef2c4 100644 --- a/net/cloud-init/distinfo +++ b/net/cloud-init/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1611086699 -SHA256 (canonical-cloud-init-20.4.1_GH0.tar.gz) = 76187a5b1cdda31fe46e993b70e9a3ef5759f5d3cf84eb08520ea19ea80ebcad -SIZE (canonical-cloud-init-20.4.1_GH0.tar.gz) = 1240251 +TIMESTAMP = 1625456512 +SHA256 (canonical-cloud-init-21.2_GH0.tar.gz) = f9ee63692a68102c396daf6e9fff5c1dfdec44cba478b4659484f68e58d1b3ca +SIZE (canonical-cloud-init-21.2_GH0.tar.gz) = 1289949 diff --git a/net/cloud-init/files/patch-cloudinit_net_bsd.py b/net/cloud-init/files/patch-cloudinit_net_bsd.py new file mode 100644 index 000000000000..72b7f34029b7 --- /dev/null +++ b/net/cloud-init/files/patch-cloudinit_net_bsd.py @@ -0,0 +1,60 @@ +--- cloudinit/net/bsd.py.orig 2021-07-05 03:47:58 UTC ++++ cloudinit/net/bsd.py +@@ -33,7 +33,7 @@ class BSDRenderer(renderer.Renderer): + self.interface_configurations = {} + self._postcmds = config.get('postcmds', True) + +- def _ifconfig_entries(self, settings, target=None): ++ def _ifconfig_entries(self, settings): + ifname_by_mac = net.get_interfaces_by_mac() + for interface in settings.iter_interfaces(): + device_name = interface.get("name") +@@ -76,9 +76,10 @@ class BSDRenderer(renderer.Renderer): + self.interface_configurations[device_name] = { + 'address': subnet.get('address'), + 'netmask': subnet.get('netmask'), ++ 'mtu': subnet.get('mtu') or interface.get('mtu'), + } + +- def _route_entries(self, settings, target=None): ++ def _route_entries(self, settings): + routes = list(settings.iter_routes()) + for interface in settings.iter_interfaces(): + subnets = interface.get("subnets", []) +@@ -101,7 +102,7 @@ class BSDRenderer(renderer.Renderer): + gateway = route.get('gateway') + self.set_route(network, netmask, gateway) + +- def _resolve_conf(self, settings, target=None): ++ def _resolve_conf(self, settings): + nameservers = settings.dns_nameservers + searchdomains = settings.dns_searchdomains + for interface in settings.iter_interfaces(): +@@ -114,11 +115,11 @@ class BSDRenderer(renderer.Renderer): + # fails. + try: + resolvconf = ResolvConf(util.load_file(subp.target_path( +- target, self.resolv_conf_fn))) ++ self.target, self.resolv_conf_fn))) + resolvconf.parse() + except IOError: + util.logexc(LOG, "Failed to parse %s, use new empty file", +- subp.target_path(target, self.resolv_conf_fn)) ++ subp.target_path(self.target, self.resolv_conf_fn)) + resolvconf = ResolvConf('') + resolvconf.parse() + +@@ -136,10 +137,12 @@ class BSDRenderer(renderer.Renderer): + except ValueError: + util.logexc(LOG, "Failed to add search domain %s", domain) + util.write_file( +- subp.target_path(target, self.resolv_conf_fn), ++ subp.target_path(self.target, self.resolv_conf_fn), + str(resolvconf), 0o644) + + def render_network_state(self, network_state, templates=None, target=None): ++ if target: ++ self.target = target + self._ifconfig_entries(settings=network_state) + self._route_entries(settings=network_state) + self._resolve_conf(settings=network_state) diff --git a/net/cloud-init/files/patch-cloudinit_net_freebsd.py b/net/cloud-init/files/patch-cloudinit_net_freebsd.py new file mode 100644 index 000000000000..0e2096721b0d --- /dev/null +++ b/net/cloud-init/files/patch-cloudinit_net_freebsd.py @@ -0,0 +1,21 @@ +--- cloudinit/net/freebsd.py.orig 2021-07-05 03:46:41 UTC ++++ cloudinit/net/freebsd.py +@@ -19,12 +19,13 @@ class Renderer(cloudinit.net.bsd.BSDRenderer): + + def write_config(self): + for device_name, v in self.interface_configurations.items(): ++ net_config = 'DHCP' + if isinstance(v, dict): +- self.set_rc_config_value( +- 'ifconfig_' + device_name, +- v.get('address') + ' netmask ' + v.get('netmask')) +- else: +- self.set_rc_config_value('ifconfig_' + device_name, 'DHCP') ++ net_config = v.get('address') + ' netmask ' + v.get('netmask') ++ mtu = v.get('mtu') ++ if mtu: ++ net_config += (' mtu %d' % mtu) ++ self.set_rc_config_value('ifconfig_' + device_name, net_config) + + def start_services(self, run=False): + if not run: