cloud-init: 21.4 -> 22.3.3

This commit is contained in:
illustris 2022-09-30 21:01:54 +05:30 committed by Rick van Schijndel
parent 79cf21151e
commit 06372b5e99
2 changed files with 20 additions and 45 deletions

View file

@ -1,27 +1,12 @@
From 269cc4c9558549f340ec186d9246654564b2f633 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
Date: Tue, 18 Aug 2020 10:22:36 +0100
Subject: [PATCH] add nixos support
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
---
cloudinit/distros/__init__.py | 1 +
cloudinit/distros/nixos.py | 103 ++++++++++++++++++++++++++++++++++
2 files changed, 104 insertions(+)
create mode 100644 cloudinit/distros/nixos.py
diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py
index 2537608f..c533b585 100755 index 4a468cf8..c60c899b 100644
--- a/cloudinit/distros/__init__.py --- a/cloudinit/distros/__init__.py
+++ b/cloudinit/distros/__init__.py +++ b/cloudinit/distros/__init__.py
@@ -47,6 +47,7 @@ OSFAMILIES = { @@ -55,6 +55,7 @@ OSFAMILIES = {
'gentoo': ['gentoo'], "virtuozzo",
'redhat': ['amazon', 'centos', 'fedora', 'rhel'], ],
'suse': ['opensuse', 'sles'], "suse": ["opensuse", "sles"],
+ 'nixos': ['nixos'], + "nixos": ["nixos"],
} }
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@ -134,6 +119,3 @@ index 00000000..d53d2a61
+ +
+ def update_package_sources(self): + def update_package_sources(self):
+ raise NotImplementedError() + raise NotImplementedError()
--
2.28.0

View file

@ -9,18 +9,19 @@
, python3 , python3
, shadow , shadow
, systemd , systemd
, coreutils
}: }:
python3.pkgs.buildPythonApplication rec { python3.pkgs.buildPythonApplication rec {
pname = "cloud-init"; pname = "cloud-init";
version = "21.4"; version = "22.3.3";
namePrefix = ""; namePrefix = "";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "canonical"; owner = "canonical";
repo = "cloud-init"; repo = "cloud-init";
rev = version; rev = version;
sha256 = "09413qz9y2csvhjb4krjnkfj97vlykx79j912p27jjcrg82f1nib"; hash = "sha256-9vdFPSmkkdJDlVfA9DgqczRoOBMmSMezdl3D/0OSbsQ=";
}; };
patches = [ ./0001-add-nixos-support.patch ]; patches = [ ./0001-add-nixos-support.patch ];
@ -30,11 +31,14 @@ python3.pkgs.buildPythonApplication rec {
--replace /lib/systemd $out/lib/systemd --replace /lib/systemd $out/lib/systemd
substituteInPlace cloudinit/net/networkd.py \ substituteInPlace cloudinit/net/networkd.py \
--replace "['/usr/sbin', '/bin']" "['/usr/sbin', '/bin', '${iproute2}/bin', '${systemd}/bin']" --replace '["/usr/sbin", "/bin"]' '["/usr/sbin", "/bin", "${iproute2}/bin", "${systemd}/bin"]'
substituteInPlace tests/unittests/test_net_activators.py \ substituteInPlace tests/unittests/test_net_activators.py \
--replace "['/usr/sbin', '/bin']" \ --replace '["/usr/sbin", "/bin"]' \
"['/usr/sbin', '/bin', '${iproute2}/bin', '${systemd}/bin']" '["/usr/sbin", "/bin", "${iproute2}/bin", "${systemd}/bin"]'
substituteInPlace tests/unittests/cmd/test_clean.py \
--replace "/bin/bash" "/bin/sh"
''; '';
postInstall = '' postInstall = ''
@ -62,6 +66,9 @@ python3.pkgs.buildPythonApplication rec {
dmidecode dmidecode
# needed for tests; at runtime we rather want the setuid wrapper # needed for tests; at runtime we rather want the setuid wrapper
shadow shadow
responses
pytest-mock
coreutils
]; ];
makeWrapperArgs = [ makeWrapperArgs = [
@ -96,20 +103,6 @@ python3.pkgs.buildPythonApplication rec {
"test_install_with_version" "test_install_with_version"
]; ];
disabledTestPaths = [
# Oracle tests are not passing
"cloudinit/sources/tests/test_oracle.py"
# Disable the integration tests. pycloudlib would be required
"tests/unittests/test_datasource/test_aliyun.py"
"tests/unittests/test_datasource/test_azure.py"
"tests/unittests/test_datasource/test_ec2.py"
"tests/unittests/test_datasource/test_exoscale.py"
"tests/unittests/test_datasource/test_gce.py"
"tests/unittests/test_datasource/test_openstack.py"
"tests/unittests/test_datasource/test_scaleway.py"
"tests/unittests/test_ec2_util.py"
];
preCheck = '' preCheck = ''
# TestTempUtils.test_mkdtemp_default_non_root does not like TMPDIR=/build # TestTempUtils.test_mkdtemp_default_non_root does not like TMPDIR=/build
export TMPDIR=/tmp export TMPDIR=/tmp
@ -119,13 +112,13 @@ python3.pkgs.buildPythonApplication rec {
"cloudinit" "cloudinit"
]; ];
passthru.tests.cloud-init = nixosTests.cloud-init; passthru.tests = { inherit (nixosTests) cloud-init cloud-init-hostname; };
meta = with lib; { meta = with lib; {
homepage = "https://cloudinit.readthedocs.org"; homepage = "https://cloudinit.readthedocs.org";
description = "Provides configuration and customization of cloud instance"; description = "Provides configuration and customization of cloud instance";
license = with licenses; [ asl20 gpl3Plus ]; license = with licenses; [ asl20 gpl3Plus ];
maintainers = with maintainers; [ madjar phile314 ]; maintainers = with maintainers; [ madjar phile314 illustris ];
platforms = platforms.all; platforms = platforms.all;
}; };
} }