Skip to content

Commit

Permalink
cloud-init: upgrade to v22.2
Browse files Browse the repository at this point in the history
Change-Id: I71c24c731aa61f9e5cd5cfb1994af2a00c72671a
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/16106
Tested-by: gerrit-photon <[email protected]>
Reviewed-by: Shreenidhi Shedi <[email protected]>
  • Loading branch information
shivania2 authored and sshedi committed May 24, 2022
1 parent 7368b7a commit a0ef4d5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 20 deletions.
24 changes: 8 additions & 16 deletions SPECS/cloud-init/cloud-init-azureds.patch
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ index d07dc3c0..c5d93a7d 100755
import json
import logging
import os
@@ -28,6 +29,7 @@ from cloudinit import (
from cloudinit.net import dhcp
@@ -19,6 +20,7 @@ from cloudinit import (
from cloudinit import distros, subp, temp_utils, url_helper, util, version
from cloudinit.reporting import events
from cloudinit.settings import CFG_BUILTIN
+from io import StringIO
Expand All @@ -23,12 +23,12 @@ index d07dc3c0..c5d93a7d 100755

+NETWORKD_LEASES_DIR = '/run/systemd/netif/leases'
+

def azure_ds_telemetry_reporter(func):
def impl(*args, **kwargs):
@@ -903,6 +907,32 @@ class WALinuxAgentShim:
) from e
return dhcp_options
@@ -942,6 +945,32 @@ class WALinuxAgentShim:
report_diagnostic_event(msg, logger_func=LOG.debug)
return goal_state

+ @staticmethod
+ def networkd_parse_lease(content):
Expand Down Expand Up @@ -56,14 +56,6 @@ index d07dc3c0..c5d93a7d 100755
+ util.load_file(os.path.join(leases_d, lfile)))
+ return ret
+
@staticmethod
@azure_ds_telemetry_reporter
def _get_value_from_dhcpoptions(dhcp_options):
@@ -956,6 +986,7 @@ class WALinuxAgentShim:
)
dhcp_options = WALinuxAgentShim._load_dhclient_json()
value = WALinuxAgentShim._get_value_from_dhcpoptions(dhcp_options)
+ LOG.debug('networkd value from lease %s', value)
if value is None:
# Fallback and check the leases file if unsuccessful
report_diagnostic_event(
def _get_user_pubkeys(
self, goal_state: GoalState, pubkey_info: list
10 changes: 7 additions & 3 deletions SPECS/cloud-init/cloud-init.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: cloud-init
Version: 22.1
Version: 22.2
Release: 1%{?dist}
Summary: Cloud instance init scripts
Group: System Environment/Base
Expand All @@ -9,7 +9,7 @@ Vendor: VMware, Inc.
Distribution: Photon

Source0: https://launchpad.net/cloud-init/trunk/%{version}/+download/%{name}-%{version}.tar.gz
%define sha1 %{name}=830185bb5ce87ad86e4d1c0c62329bb255ec1648
%define sha512 %{name}=07fec2f1d6eab20a1161672bb339a0c6b2826540bcb03936f95458b179fcb1b3142773c9a4038fe02b30bb05a5ca48a4153b6b0f59015b43bd6c6602832f9d6f

Patch0: cloud-init-azureds.patch
Patch1: ds-identify.patch
Expand Down Expand Up @@ -41,6 +41,7 @@ BuildRequires: python3-pip
BuildRequires: python3-configobj
BuildRequires: python3-jsonpatch
BuildRequires: python3-pytest
BuildRequires: python3-jsonschema
%endif

Requires: iproute2
Expand Down Expand Up @@ -106,7 +107,7 @@ echo -e 'CERT1\nLINE2\nLINE3\nCERT2\nLINE2\nLINE3' > "${crt_file}"
conf_file='/etc/ca-certificates.conf'
echo -e 'line1\nline2\nline3\ncloud-init-ca-certs.crt\n' > "${conf_file}"

%define test_pkgs pytest-metadata unittest2 mock attrs iniconfig httpretty netifaces
%define test_pkgs pytest-metadata unittest2 mock attrs iniconfig httpretty netifaces responses pytest-mock

pip3 install --upgrade %test_pkgs
make check %{?_smp_mflags}
Expand All @@ -127,6 +128,7 @@ rm -rf %{buildroot}
%systemd_postun %cl_services

%files
%defattr(-,root,root)
%{_bindir}/*
%license LICENSE
%{python3_sitelib}/*
Expand All @@ -147,6 +149,8 @@ rm -rf %{buildroot}
%{_sysconfdir}/systemd/system/[email protected]/disable-sshd-keygen-if-cloud-init-active.conf

%changelog
* Thu May 19 2022 Shivani Agarwal <[email protected]> 22.2-1
- Upgrade to v22.2
* Thu Feb 17 2022 Shreenidhi Shedi <[email protected]> 22.1-1
- Upgrade to v22.1
* Mon Nov 15 2021 Shreenidhi Shedi <[email protected]> 21.4-1
Expand Down
2 changes: 1 addition & 1 deletion SPECS/cloud-init/ds-identify.patch
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ index f509f566..2aeb1655 100755
-DI_DEFAULT_POLICY="search,found=all,maybe=all,notfound=${DI_DISABLED}"
+DI_DEFAULT_POLICY="search,found=all,maybe=all,notfound=${DI_ENABLED}"
DI_DEFAULT_POLICY_NO_DMI="search,found=all,maybe=all,notfound=${DI_ENABLED}"
DI_DMI_BOARD_NAME=""
DI_DMI_CHASSIS_ASSET_TAG=""
DI_DMI_PRODUCT_NAME=""
--
2.32.0

0 comments on commit a0ef4d5

Please sign in to comment.