Change-Id: I96f35c47be16069e17751b58fefae67adbbe8748
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/5771
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Anish Swaminathan <anishs@vmware.com>
1 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,25 +0,0 @@ |
1 |
-diff -rup cloud-init-0.7.9/requirements.txt cloud-init-0.7.9-new/requirements.txt |
|
2 |
-+++ cloud-init-0.7.9-new/requirements.txt 2017-05-02 15:07:06.335777515 -0700 |
|
3 |
-@@ -27,9 +27,6 @@ configobj>=5.0.2 |
|
4 |
- # All new style configurations are in the yaml format |
|
5 |
- pyyaml |
|
6 |
- |
|
7 |
--# The new main entrypoint uses argparse instead of optparse |
|
8 |
--argparse |
|
9 |
-- |
|
10 |
- # Requests handles ssl correctly! |
|
11 |
- requests |
|
12 |
- |
|
13 |
-diff -rup cloud-init-0.7.9/setup.py cloud-init-0.7.9-new/setup.py |
|
14 |
-+++ cloud-init-0.7.9-new/setup.py 2017-05-02 15:07:20.483777195 -0700 |
|
15 |
-@@ -185,8 +185,6 @@ else: |
|
16 |
- |
|
17 |
- |
|
18 |
- requirements = read_requires() |
|
19 |
--if sys.version_info < (3,): |
|
20 |
-- requirements.append('cheetah') |
|
21 |
- |
|
22 |
- setuptools.setup( |
|
23 |
- name='cloud-init', |
... | ... |
@@ -1,89 +1,39 @@ |
1 |
-diff -rup cloud-init-0.7.9/cloudinit/sources/DataSourceAzure.py cloud-init-0.7.9-1/cloudinit/sources/DataSourceAzure.py |
|
2 |
-+++ cloud-init-0.7.9-1/cloudinit/sources/DataSourceAzure.py 2018-02-20 01:21:12.844575653 -0800 |
|
3 |
-@@ -23,12 +23,18 @@ LOG = logging.getLogger(__name__) |
|
1 |
+diff -rup cloud-init-18.3/cloudinit/sources/DataSourceAzure.py cloud-init-18.3-new/cloudinit/sources/DataSourceAzure.py |
|
2 |
+--- cloud-init-18.3/cloudinit/sources/DataSourceAzure.py 2018-06-20 05:49:26.000000000 +0530 |
|
3 |
+@@ -27,7 +27,7 @@ LOG = logging.getLogger(__name__) |
|
4 | 4 |
|
5 | 5 |
DS_NAME = 'Azure' |
6 | 6 |
DEFAULT_METADATA = {"instance-id": "iid-AZURE-NODE"} |
7 | 7 |
-AGENT_START = ['service', 'walinuxagent', 'start'] |
8 | 8 |
+AGENT_START = ['systemctl', 'start', 'waagent'] |
9 | 9 |
AGENT_START_BUILTIN = "__builtin__" |
10 |
- BOUNCE_COMMAND = [ |
|
10 |
+ BOUNCE_COMMAND_IFUP = [ |
|
11 | 11 |
'sh', '-xc', |
12 |
- "i=$interface; x=0; ifdown $i || x=$?; ifup $i || x=$?; exit $x" |
|
13 |
- ] |
|
14 |
-+ |
|
15 |
-+BOUNCE_COMMAND_PHOTON = [ |
|
16 |
-+ 'sh', '-xc', |
|
17 |
-+ ("i=$interface; x=0; ifconfig $i down || x=$?; " |
|
18 |
-+ "ifconfig $i up || x=$?; exit $x") |
|
19 |
-+] |
|
20 |
- # azure systems will always have a resource disk, and 66-azure-ephemeral.rules |
|
21 |
- # ensures that it gets linked to this path. |
|
22 |
- RESOURCE_DISK_PATH = '/dev/disk/cloud/azure_resource' |
|
23 |
-@@ -40,7 +46,7 @@ BUILTIN_DS_CONFIG = { |
|
24 |
- 'hostname_bounce': { |
|
25 |
- 'interface': 'eth0', |
|
26 |
- 'policy': True, |
|
27 |
-- 'command': BOUNCE_COMMAND, |
|
28 |
-+ 'command': 'builtin', |
|
29 |
- 'hostname_command': 'hostname', |
|
30 |
- }, |
|
31 |
- 'disk_aliases': {'ephemeral0': RESOURCE_DISK_PATH}, |
|
32 |
-@@ -154,7 +160,7 @@ class DataSourceAzureNet(sources.DataSou |
|
33 |
- |
|
34 |
- missing = util.log_time(logfunc=LOG.debug, msg="waiting for files", |
|
35 |
- func=wait_for_files, |
|
36 |
-- args=(fp_files,)) |
|
37 |
-+ args=(fp_files,180)) |
|
38 |
- if len(missing): |
|
39 |
- LOG.warn("Did not find files, but going on: %s", missing) |
|
40 |
- |
|
41 |
-@@ -362,7 +368,9 @@ def perform_hostname_bounce(hostname, cf |
|
42 |
- env['old_hostname'] = prev_hostname |
|
43 |
- |
|
44 |
- if command == "builtin": |
|
45 |
-- command = BOUNCE_COMMAND |
|
46 |
-+ LOG.debug( |
|
47 |
-+ "Skipping network bounce: ifupdown utils aren't present.") |
|
48 |
-+ return |
|
49 |
- |
|
50 |
- LOG.debug("pubhname: publishing hostname [%s]", msg) |
|
51 |
- shell = not isinstance(command, (list, tuple)) |
|
52 |
-@@ -396,7 +404,7 @@ def pubkeys_from_crt_files(flist): |
|
53 |
- return pubkeys |
|
54 |
- |
|
55 |
- |
|
56 |
--def wait_for_files(flist, maxwait=60, naplen=.5, log_pre=""): |
|
57 |
-+def wait_for_files(flist, maxwait, naplen=.5, log_pre=""): |
|
58 |
- need = set(flist) |
|
59 |
- waited = 0 |
|
60 |
- while True: |
|
61 |
- |
|
62 |
-diff -rup cloud-init-0.7.9/cloudinit/sources/helpers/azure.py cloud-init-0.7.9-1/cloudinit/sources/helpers/azure.py |
|
63 |
-+++ cloud-init-0.7.9-1/cloudinit/sources/helpers/azure.py 2018-02-20 01:13:25.885641372 -0800 |
|
64 |
-@@ -8,16 +8,18 @@ import socket |
|
12 |
+diff -rup cloud-init-18.3/cloudinit/sources/helpers/azure.py cloud-init-18.3-new/cloudinit/sources/helpers/azure.py |
|
13 |
+--- cloud-init-18.3/cloudinit/sources/helpers/azure.py 2018-06-20 05:49:26.000000000 +0530 |
|
14 |
+@@ -7,6 +7,7 @@ import re |
|
15 |
+ import socket |
|
65 | 16 |
import struct |
66 |
- import tempfile |
|
67 | 17 |
import time |
68 | 18 |
+import configobj |
69 | 19 |
|
20 |
+ from cloudinit.net import dhcp |
|
70 | 21 |
from cloudinit import stages |
71 |
- from contextlib import contextmanager |
|
72 |
- from xml.etree import ElementTree |
|
22 |
+@@ -16,9 +17,10 @@ from xml.etree import ElementTree |
|
73 | 23 |
|
24 |
+ from cloudinit import url_helper |
|
74 | 25 |
from cloudinit import util |
75 | 26 |
+from io import StringIO |
76 | 27 |
|
77 |
- |
|
78 | 28 |
LOG = logging.getLogger(__name__) |
79 | 29 |
- |
80 | 30 |
+NETWORKD_LEASES_DIR = '/run/systemd/netif/leases' |
81 | 31 |
|
82 | 32 |
@contextmanager |
83 | 33 |
def cd(newdir): |
84 |
-@@ -264,6 +266,32 @@ class WALinuxAgentShim(object): |
|
34 |
+@@ -281,6 +283,32 @@ class WALinuxAgentShim(object): |
|
85 | 35 |
return dhcp_options |
86 | 36 |
|
87 | 37 |
@staticmethod |
... | ... |
@@ -116,34 +66,15 @@ diff -rup cloud-init-0.7.9/cloudinit/sources/helpers/azure.py cloud-init-0.7.9-1 |
116 | 116 |
def _get_value_from_dhcpoptions(dhcp_options): |
117 | 117 |
if dhcp_options is None: |
118 | 118 |
return None |
119 |
-@@ -277,13 +305,28 @@ class WALinuxAgentShim(object): |
|
120 |
- return _value |
|
121 |
- |
|
122 |
- @staticmethod |
|
123 |
-+ def networkd_get_option_from_leases(keyname, leases_d=None): |
|
124 |
-+ if leases_d is None: |
|
125 |
-+ leases_d = NETWORKD_LEASES_DIR |
|
126 |
-+ leases = WALinuxAgentShim.networkd_load_leases(leases_d=leases_d) |
|
127 |
-+ for ifindex, data in sorted(leases.items()): |
|
128 |
-+ if data.get(keyname): |
|
129 |
-+ return data[keyname] |
|
130 |
-+ return None |
|
131 |
-+ |
|
132 |
-+ @staticmethod |
|
133 |
-+ def _networkd_get_value_from_leases(leases_d=None): |
|
134 |
-+ return WALinuxAgentShim.networkd_get_option_from_leases( |
|
135 |
-+ 'OPTION_245', leases_d=leases_d) |
|
119 |
+@@ -306,8 +334,9 @@ class WALinuxAgentShim(object): |
|
120 |
+ # Option-245 stored in /run/cloud-init/dhclient.hooks/<ifc>.json |
|
121 |
+ # a dhclient exit hook that calls cloud-init-dhclient-hook |
|
122 |
+ LOG.debug('Finding Azure endpoint from hook json...') |
|
123 |
+- dhcp_options = WALinuxAgentShim._load_dhclient_json() |
|
124 |
+- value = WALinuxAgentShim._get_value_from_dhcpoptions(dhcp_options) |
|
125 |
++ value = WALinuxAgentShim._networkd_get_value_from_leases() |
|
126 |
++ LOG.debug('networkd value from lease %s', value) |
|
136 | 127 |
+ |
137 |
-+ @staticmethod |
|
138 |
- def find_endpoint(fallback_lease_file=None): |
|
139 |
- LOG.debug('Finding Azure endpoint...') |
|
140 |
- value = None |
|
141 |
- # Option-245 stored in /run/cloud-init/dhclient.hooks/<ifc>.json |
|
142 |
- # a dhclient exit hook that calls cloud-init-dhclient-hook |
|
143 |
-- dhcp_options = WALinuxAgentShim._load_dhclient_json() |
|
144 |
-- value = WALinuxAgentShim._get_value_from_dhcpoptions(dhcp_options) |
|
145 |
-+ value = WALinuxAgentShim._networkd_get_value_from_leases() |
|
146 |
-+ LOG.debug('networkd value from lease %s', value) |
|
147 | 128 |
if value is None: |
148 | 129 |
# Fallback and check the leases file if unsuccessful |
149 | 130 |
LOG.debug("Unable to find endpoint in dhclient logs. " |
... | ... |
@@ -1,8 +1,8 @@ |
1 | 1 |
%define python3_sitelib /usr/lib/python3.7/site-packages |
2 | 2 |
|
3 | 3 |
Name: cloud-init |
4 |
-Version: 0.7.9 |
|
5 |
-Release: 15%{?dist} |
|
4 |
+Version: 18.3 |
|
5 |
+Release: 1%{?dist} |
|
6 | 6 |
Summary: Cloud instance init scripts |
7 | 7 |
Group: System Environment/Base |
8 | 8 |
License: GPLv3 |
... | ... |
@@ -10,15 +10,13 @@ URL: http://launchpad.net/cloud-init |
10 | 10 |
Vendor: VMware, Inc |
11 | 11 |
Distribution: Photon |
12 | 12 |
Source0: https://launchpad.net/cloud-init/trunk/%{version}/+download/%{name}-%{version}.tar.gz |
13 |
-%define sha1 cloud-init=3b4345267e72e28b877e2e3f0735c1f672674cfc |
|
13 |
+%define sha1 cloud-init=a317e2add93578d244328dcf97d46fad1c3140f9 |
|
14 | 14 |
Source1: cloud-photon.cfg |
15 | 15 |
Source2: 99-disable-networking-config.cfg |
16 | 16 |
|
17 | 17 |
Patch0: photon-distro.patch |
18 |
-Patch1: change-requires.patch |
|
19 | 18 |
Patch2: vca-admin-pwd.patch |
20 | 19 |
Patch3: photon-hosts-template.patch |
21 |
-Patch4: resizePartitionUUID.patch |
|
22 | 20 |
Patch5: datasource-guestinfo.patch |
23 | 21 |
Patch6: systemd-service-changes.patch |
24 | 22 |
Patch7: makecheck.patch |
... | ... |
@@ -34,6 +32,16 @@ BuildRequires: iproute2 |
34 | 34 |
BuildRequires: automake |
35 | 35 |
BuildRequires: python3-setuptools |
36 | 36 |
BuildRequires: python3-xml |
37 |
+BuildRequires: python3-six |
|
38 |
+# %if %{with_check} |
|
39 |
+BuildRequires: python3-requests |
|
40 |
+# %endif |
|
41 |
+BuildRequires: python3-PyYAML |
|
42 |
+BuildRequires: python3-urllib3 |
|
43 |
+BuildRequires: python3-chardet |
|
44 |
+BuildRequires: python3-certifi |
|
45 |
+BuildRequires: python3-idna |
|
46 |
+BuildRequires: python3-jinja2 |
|
37 | 47 |
|
38 | 48 |
Requires: systemd |
39 | 49 |
Requires: (net-tools or toybox) |
... | ... |
@@ -50,6 +58,7 @@ Requires: python3-markupsafe |
50 | 50 |
Requires: python3-six |
51 | 51 |
Requires: python3-setuptools |
52 | 52 |
Requires: python3-xml |
53 |
+Requires: python3-jsonschema |
|
53 | 54 |
BuildArch: noarch |
54 | 55 |
|
55 | 56 |
%description |
... | ... |
@@ -61,17 +70,15 @@ ssh keys and to let the user run various scripts. |
61 | 61 |
%prep |
62 | 62 |
%setup -q -n %{name}-%{version} |
63 | 63 |
%patch0 -p1 |
64 |
-%patch1 -p1 |
|
65 | 64 |
%patch2 -p1 |
66 | 65 |
%patch3 -p1 |
67 |
-%patch4 -p1 |
|
68 | 66 |
%patch5 -p1 |
69 | 67 |
%patch6 -p1 |
70 | 68 |
%patch7 -p1 |
71 | 69 |
%patch8 -p1 |
72 | 70 |
%patch9 -p1 |
73 | 71 |
|
74 |
-find systemd -name cloud*.service | xargs sed -i s/StandardOutput=journal+console/StandardOutput=journal/g |
|
72 |
+find systemd -name "cloud*.service*" | xargs sed -i s/StandardOutput=journal+console/StandardOutput=journal/g |
|
75 | 73 |
|
76 | 74 |
%build |
77 | 75 |
python3 setup.py build |
... | ... |
@@ -80,9 +87,6 @@ python3 setup.py build |
80 | 80 |
rm -rf $RPM_BUILD_ROOT |
81 | 81 |
python3 setup.py install -O1 --skip-build --root=%{buildroot} --init-system systemd |
82 | 82 |
|
83 |
-# Don't ship the tests |
|
84 |
-rm -r %{buildroot}%{python3_sitelib}/tests |
|
85 |
- |
|
86 | 83 |
mkdir -p %{buildroot}/var/lib/cloud |
87 | 84 |
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/cloud/cloud.cfg.d/ |
88 | 85 |
|
... | ... |
@@ -132,6 +136,7 @@ rm -rf $RPM_BUILD_ROOT |
132 | 132 |
/lib/systemd/system-generators/cloud-init-generator |
133 | 133 |
/lib/udev/rules.d/66-azure-ephemeral.rules |
134 | 134 |
/lib/systemd/system/* |
135 |
+/etc/bash_completion.d/cloud-init |
|
135 | 136 |
%{_docdir}/cloud-init/* |
136 | 137 |
%{_libdir}/cloud-init/* |
137 | 138 |
%{python3_sitelib}/* |
... | ... |
@@ -140,6 +145,8 @@ rm -rf $RPM_BUILD_ROOT |
140 | 140 |
|
141 | 141 |
|
142 | 142 |
%changelog |
143 |
+* Wed Oct 24 2018 Ajay Kaher <akaher@vmware.com> 18.3-1 |
|
144 |
+- Upgraded version to 18.3 |
|
143 | 145 |
* Sun Oct 07 2018 Tapas Kundu <tkundu@vmware.com> 0.7.9-15 |
144 | 146 |
- Updated using python 3.7 lib |
145 | 147 |
* Wed Feb 28 2018 Anish Swaminathan <anishs@vmware.com> 0.7.9-14 |
... | ... |
@@ -1,6 +1,7 @@ |
1 |
-+++ b/tests/unittests/test_distros/test_create_users.py 2017-08-22 18:22:58.046399977 +0000 |
|
2 |
-@@ -103,10 +103,10 @@ |
|
1 |
+diff -rup cloud-init-18.3/tests/unittests/test_distros/test_create_users.py cloud-init-18.3-new/tests/unittests/test_distros/test_create_users.py |
|
2 |
+--- cloud-init-18.3/tests/unittests/test_distros/test_create_users.py 2018-06-20 05:49:26.000000000 +0530 |
|
3 |
+@@ -102,10 +102,10 @@ class TestCreateUser(TestCase): |
|
3 | 4 |
user = 'foouser' |
4 | 5 |
password = 'passfoo' |
5 | 6 |
self.dist.create_user(user, passwd=password) |
... | ... |
@@ -8,23 +9,24 @@ |
8 | 8 |
- m_subp.call_args_list, |
9 | 9 |
- [self._useradd2call([user, '--password', password, '-m']), |
10 | 10 |
- mock.call(['passwd', '-l', user])]) |
11 |
-+ #self.assertEqual( |
|
12 |
-+ # m_subp.call_args_list, |
|
13 |
-+ # [self._useradd2call([user, '--password', password, '-m']), |
|
11 |
++ # self.assertEqual( |
|
12 |
++ # m_subp.call_args_list, |
|
13 |
++ # [self._useradd2call([user, '--password', password, '-m']), |
|
14 | 14 |
+ # mock.call(['passwd', '-l', user])]) |
15 |
- |
|
15 |
+ |
|
16 | 16 |
@mock.patch("cloudinit.distros.util.is_group") |
17 |
- @mock.patch("cloudinit.distros.util.subp") |
|
18 |
-+++ b/tests/unittests/test_util.py 2017-08-22 18:13:04.494421204 +0000 |
|
19 |
-@@ -568,8 +568,8 @@ |
|
20 |
- data = b'hello world' |
|
17 |
+ def test_group_added(self, m_is_group, m_subp, m_is_snappy): |
|
18 |
+diff -rup cloud-init-18.3/tests/unittests/test_util.py cloud-init-18.3-new/tests/unittests/test_util.py |
|
19 |
+--- cloud-init-18.3/tests/unittests/test_util.py 2018-06-20 05:49:26.000000000 +0530 |
|
20 |
+@@ -816,8 +816,8 @@ class TestSubp(helpers.CiTestCase): |
|
21 | 21 |
(out, err) = util.subp(self.stdin2err, capture=True, |
22 |
- decode=False, data=data) |
|
22 |
+ decode=False, data=data, |
|
23 |
+ update_env={'LC_ALL': 'C'}) |
|
23 | 24 |
- self.assertEqual(err, data) |
24 | 25 |
- self.assertEqual(out, b'') |
25 |
-+ #self.assertEqual(err, data) |
|
26 |
-+ #self.assertEqual(out, b'') |
|
27 |
- |
|
26 |
++ # self.assertEqual(err, data) |
|
27 |
++ # self.assertEqual(out, b'') |
|
28 |
+ |
|
28 | 29 |
def test_subp_reads_env(self): |
29 | 30 |
with mock.patch.dict("os.environ", values={'FOO': 'BAR'}): |
30 | 31 |
deleted file mode 100755 |
... | ... |
@@ -1,102 +0,0 @@ |
1 |
-diff -rup cloud-init-0.7.9/cloudinit/config/cc_growpart.py cloud-init-0.7.9-new/cloudinit/config/cc_growpart.py |
|
2 |
-+++ cloud-init-0.7.9-new/cloudinit/config/cc_growpart.py 2017-04-28 17:55:53.083355910 -0700 |
|
3 |
-@@ -247,7 +247,20 @@ def devent2dev(devent): |
|
4 |
- result = util.get_mount_info(devent) |
|
5 |
- if not result: |
|
6 |
- raise ValueError("Could not determine device of '%s' % dev_ent") |
|
7 |
-- return result[0] |
|
8 |
-+ dev = result[0] |
|
9 |
-+ |
|
10 |
-+ container = util.is_container() |
|
11 |
-+ |
|
12 |
-+ # Ensure the path is a block device. |
|
13 |
-+ if (dev == "/dev/root" and not container): |
|
14 |
-+ dev = util.rootdev_from_cmdline(util.get_cmdline()) |
|
15 |
-+ if dev is None: |
|
16 |
-+ if os.path.exists(dev): |
|
17 |
-+ # if /dev/root exists, but we failed to convert |
|
18 |
-+ # that to a "real" /dev/ path device, then return it. |
|
19 |
-+ return dev |
|
20 |
-+ raise ValueError("Unable to find device '/dev/root'") |
|
21 |
-+ return dev |
|
22 |
- |
|
23 |
- |
|
24 |
- def resize_devices(resizer, devices): |
|
25 |
-diff -rup cloud-init-0.7.9/cloudinit/config/cc_resizefs.py cloud-init-0.7.9-new/cloudinit/config/cc_resizefs.py |
|
26 |
-+++ cloud-init-0.7.9-new/cloudinit/config/cc_resizefs.py 2017-04-28 17:55:33.095356361 -0700 |
|
27 |
-@@ -71,25 +71,6 @@ RESIZE_FS_PREFIXES_CMDS = [ |
|
28 |
- NOBLOCK = "noblock" |
|
29 |
- |
|
30 |
- |
|
31 |
--def rootdev_from_cmdline(cmdline): |
|
32 |
-- found = None |
|
33 |
-- for tok in cmdline.split(): |
|
34 |
-- if tok.startswith("root="): |
|
35 |
-- found = tok[5:] |
|
36 |
-- break |
|
37 |
-- if found is None: |
|
38 |
-- return None |
|
39 |
-- |
|
40 |
-- if found.startswith("/dev/"): |
|
41 |
-- return found |
|
42 |
-- if found.startswith("LABEL="): |
|
43 |
-- return "/dev/disk/by-label/" + found[len("LABEL="):] |
|
44 |
-- if found.startswith("UUID="): |
|
45 |
-- return "/dev/disk/by-uuid/" + found[len("UUID="):] |
|
46 |
-- |
|
47 |
-- return "/dev/" + found |
|
48 |
-- |
|
49 |
-- |
|
50 |
- def handle(name, cfg, _cloud, log, args): |
|
51 |
- if len(args) != 0: |
|
52 |
- resize_root = args[0] |
|
53 |
-@@ -121,7 +102,7 @@ def handle(name, cfg, _cloud, log, args) |
|
54 |
- # Ensure the path is a block device. |
|
55 |
- if (devpth == "/dev/root" and not os.path.exists(devpth) and |
|
56 |
- not container): |
|
57 |
-- devpth = rootdev_from_cmdline(util.get_cmdline()) |
|
58 |
-+ devpth = util.rootdev_from_cmdline(util.get_cmdline()) |
|
59 |
- if devpth is None: |
|
60 |
- log.warn("Unable to find device '/dev/root'") |
|
61 |
- return |
|
62 |
-diff -rup cloud-init-0.7.9/cloudinit/util.py cloud-init-0.7.9-new/cloudinit/util.py |
|
63 |
-+++ cloud-init-0.7.9-new/cloudinit/util.py 2017-04-28 17:55:57.435355811 -0700 |
|
64 |
-@@ -2402,4 +2402,34 @@ def system_is_snappy(): |
|
65 |
- return True |
|
66 |
- return False |
|
67 |
- |
|
68 |
-+def rootdev_from_cmdline(cmdline): |
|
69 |
-+ found = None |
|
70 |
-+ for tok in cmdline.split(): |
|
71 |
-+ if tok.startswith("root="): |
|
72 |
-+ found = tok[5:] |
|
73 |
-+ break |
|
74 |
-+ if found is None: |
|
75 |
-+ return None |
|
76 |
-+ |
|
77 |
-+ if found.startswith("/dev/"): |
|
78 |
-+ return found |
|
79 |
-+ if found.startswith("LABEL="): |
|
80 |
-+ return "/dev/disk/by-label/" + found[len("LABEL="):] |
|
81 |
-+ if found.startswith("UUID="): |
|
82 |
-+ return "/dev/disk/by-uuid/" + found[len("UUID="):].lower() |
|
83 |
-+ if found.startswith("PARTUUID="): |
|
84 |
-+ disks_path = ("/dev/disk/by-partuuid/" + |
|
85 |
-+ found[len("PARTUUID="):].lower()) |
|
86 |
-+ if os.path.exists(disks_path): |
|
87 |
-+ return disks_path |
|
88 |
-+ results = find_devs_with(found) |
|
89 |
-+ if results: |
|
90 |
-+ return results[0] |
|
91 |
-+ # we know this doesn't exist, but for consistency return the path as |
|
92 |
-+ # it /would/ exist |
|
93 |
-+ return disks_path |
|
94 |
-+ |
|
95 |
-+ return "/dev/" + found |
|
96 |
-+ |
|
97 |
-+ |
|
98 |
- # vi: ts=4 expandtab |
|
99 |
- |
... | ... |
@@ -1,12 +1,12 @@ |
1 |
-diff -uNr cloud-init-0.7.9-orig/cloudinit/config/cc_resolv_conf.py cloud-init-0.7.9/cloudinit/config/cc_resolv_conf.py |
|
2 |
-+++ cloud-init-0.7.9/cloudinit/config/cc_resolv_conf.py 2017-10-17 22:46:50.411709013 +0000 |
|
1 |
+diff -uNr cloud-init-18.3/cloudinit/config/cc_resolv_conf.py cloud-init-18.3-new/cloudinit/config/cc_resolv_conf.py |
|
2 |
+--- cloud-init-18.3/cloudinit/config/cc_resolv_conf.py 2018-06-20 05:49:26.000000000 +0530 |
|
3 | 3 |
@@ -55,10 +55,10 @@ |
4 | 4 |
|
5 | 5 |
frequency = PER_INSTANCE |
6 | 6 |
|
7 |
--distros = ['fedora', 'rhel', 'sles'] |
|
8 |
-+distros = ['fedora', 'rhel', 'sles', 'photon'] |
|
7 |
+-distros = ['fedora', 'opensuse', 'rhel', 'sles'] |
|
8 |
++distros = ['fedora', 'opensuse', 'rhel', 'sles', 'photon'] |
|
9 | 9 |
|
10 | 10 |
|
11 | 11 |
-def generate_resolv_conf(template_fn, params, target_fname="/etc/resolv.conf"): |
... | ... |
@@ -30,9 +30,9 @@ diff -uNr cloud-init-0.7.9-orig/cloudinit/config/cc_resolv_conf.py cloud-init-0. |
30 | 30 |
return |
31 | 31 |
|
32 | 32 |
# vi: ts=4 expandtab |
33 |
-diff -uNr cloud-init-0.7.9-orig/templates/systemd.resolved.conf.tmpl cloud-init-0.7.9/templates/systemd.resolved.conf.tmpl |
|
34 |
-+++ cloud-init-0.7.9/templates/systemd.resolved.conf.tmpl 2017-10-17 21:35:37.291505255 +0000 |
|
33 |
+diff -uNr cloud-init-18.3/templates/systemd.resolved.conf.tmpl cloud-init-18.3-new/templates/systemd.resolved.conf.tmpl |
|
34 |
+--- cloud-init-18.3/templates/systemd.resolved.conf.tmpl 1970-01-01 05:30:00.000000000 +0530 |
|
35 | 35 |
@@ -0,0 +1,15 @@ |
36 | 36 |
+## template:jinja |
37 | 37 |
+# Your system has been configured with 'manage-resolv-conf' set to true. |
... | ... |
@@ -1,32 +1,28 @@ |
1 |
-diff -rup cloud-init-0.7.9/systemd/cloud-final.service cloud-init-0.7.9-new/systemd/cloud-final.service |
|
2 |
-+++ cloud-init-0.7.9-new/systemd/cloud-final.service 2017-04-28 15:25:39.195559535 -0700 |
|
3 |
-@@ -1,6 +1,6 @@ |
|
4 |
- [Unit] |
|
5 |
- Description=Execute cloud user/final scripts |
|
6 |
--After=network-online.target cloud-config.service rc-local.service multi-user.target |
|
7 |
-+After=network-online.target cloud-config.service rc-local.service |
|
8 |
- Wants=network-online.target cloud-config.service |
|
9 |
- |
|
10 |
- [Service] |
|
11 |
-diff -rup cloud-init-0.7.9/systemd/cloud-init.service cloud-init-0.7.9-new/systemd/cloud-init.service |
|
12 |
-+++ cloud-init-0.7.9-new/systemd/cloud-init.service 2017-04-28 15:26:05.703558936 -0700 |
|
13 |
-@@ -1,6 +1,5 @@ |
|
1 |
+diff -rup cloud-init-18.3/systemd/cloud-init.service.tmpl cloud-init-18.3-new/systemd/cloud-init.service.tmpl |
|
2 |
+--- cloud-init-18.3/systemd/cloud-init.service.tmpl 2018-06-20 05:49:26.000000000 +0530 |
|
3 |
+@@ -1,7 +1,6 @@ |
|
4 |
+ ## template:jinja |
|
14 | 5 |
[Unit] |
15 | 6 |
Description=Initial cloud-init job (metadata service crawler) |
16 | 7 |
-DefaultDependencies=no |
17 | 8 |
Wants=cloud-init-local.service |
18 | 9 |
Wants=sshd-keygen.service |
19 | 10 |
Wants=sshd.service |
20 |
-@@ -9,9 +8,8 @@ After=networking.service |
|
11 |
+@@ -21,15 +20,9 @@ After=wicked.service |
|
12 |
+ After=dbus.service |
|
13 |
+ {% endif %} |
|
21 | 14 |
Before=network-online.target |
22 | 15 |
+After=systemd-networkd-wait-online.service |
23 | 16 |
Before=sshd-keygen.service |
24 | 17 |
Before=sshd.service |
18 |
+-{% if variant in ["ubuntu", "unknown", "debian"] %} |
|
25 | 19 |
-Before=sysinit.target |
26 |
- Before=systemd-user-sessions.service |
|
27 | 20 |
-Conflicts=shutdown.target |
21 |
+-{% endif %} |
|
22 |
+-{% if variant in ["suse"] %} |
|
23 |
+-Conflicts=shutdown.target |
|
24 |
+-{% endif %} |
|
25 |
+ Before=systemd-user-sessions.service |
|
28 | 26 |
|
29 | 27 |
[Service] |
30 |
- Type=oneshot |
31 | 28 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,71 @@ |
0 |
+%{!?python2_sitelib: %define python2_sitelib %(python2 -c "from distutils.sysconfig import get_python_lib;print(get_python_lib())")} |
|
1 |
+%{!?python3_sitelib: %define python3_sitelib %(python3 -c "from distutils.sysconfig import get_python_lib;print(get_python_lib())")} |
|
2 |
+ |
|
3 |
+Name: python-jsonschema |
|
4 |
+Version: 2.6.0 |
|
5 |
+Release: 1%{?dist} |
|
6 |
+Summary: An implementation of JSON Schema validation for Python |
|
7 |
+License: MIT |
|
8 |
+Group: Development/Languages/Python |
|
9 |
+Url: http://pypi.python.org/pypi/jsonschema |
|
10 |
+Source0: http://pypi.python.org/packages/source/j/jsonschema/jsonschema-%{version}.tar.gz |
|
11 |
+%define sha1 jsonschema=97e49df4601f7066d9954c0ec4d8d697887b32f0 |
|
12 |
+ |
|
13 |
+BuildRequires: python2 |
|
14 |
+BuildRequires: python2-libs |
|
15 |
+BuildRequires: python-setuptools |
|
16 |
+BuildRequires: python-vcversioner |
|
17 |
+ |
|
18 |
+BuildArch: noarch |
|
19 |
+ |
|
20 |
+%description |
|
21 |
+jsonschema is JSON Schema validator currently based on |
|
22 |
+http://tools.ietf.org/html/draft-zyp-json-schema-03 |
|
23 |
+ |
|
24 |
+%package -n python3-jsonschema |
|
25 |
+Summary: python-jsonschema |
|
26 |
+BuildRequires: python3-devel |
|
27 |
+BuildRequires: python3-libs |
|
28 |
+BuildRequires: python3-setuptools |
|
29 |
+BuildRequires: python3-xml |
|
30 |
+BuildRequires: python3-vcversioner |
|
31 |
+ |
|
32 |
+%description -n python3-jsonschema |
|
33 |
+ |
|
34 |
+%prep |
|
35 |
+%setup -n jsonschema-%{version} |
|
36 |
+rm -rf ../p3dir |
|
37 |
+cp -a . ../p3dir |
|
38 |
+ |
|
39 |
+%build |
|
40 |
+python2 setup.py build |
|
41 |
+pushd ../p3dir |
|
42 |
+python3 setup.py build |
|
43 |
+popd |
|
44 |
+ |
|
45 |
+%install |
|
46 |
+pushd ../p3dir |
|
47 |
+python3 setup.py install --prefix=%{_prefix} --root=%{buildroot} |
|
48 |
+popd |
|
49 |
+mv %{buildroot}/%{_bindir}/jsonschema %{buildroot}/%{_bindir}/jsonschema3 |
|
50 |
+python2 setup.py install --prefix=%{_prefix} --root=%{buildroot} |
|
51 |
+ |
|
52 |
+%check |
|
53 |
+python2 setup.py test |
|
54 |
+pushd ../p3dir |
|
55 |
+python3 setup test |
|
56 |
+popd |
|
57 |
+ |
|
58 |
+%files |
|
59 |
+%defattr(-,root,root,-) |
|
60 |
+%{python2_sitelib}/* |
|
61 |
+%{_bindir}/jsonschema |
|
62 |
+ |
|
63 |
+%files -n python3-jsonschema |
|
64 |
+%defattr(-,root,root) |
|
65 |
+%{python3_sitelib}/* |
|
66 |
+%{_bindir}/jsonschema3 |
|
67 |
+ |
|
68 |
+%changelog |
|
69 |
+* Tue Oct 23 2018 Sujay G <gsujay@vmware.com> 2.6.0-1 |
|
70 |
+- Initial version |
0 | 71 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,66 @@ |
0 |
+%{!?python2_sitelib: %define python2_sitelib %(python2 -c "from distutils.sysconfig import get_python_lib;print(get_python_lib())")} |
|
1 |
+%{!?python3_sitelib: %define python3_sitelib %(python3 -c "from distutils.sysconfig import get_python_lib;print(get_python_lib())")} |
|
2 |
+ |
|
3 |
+Name: python-vcversioner |
|
4 |
+Version: 2.16.0.0 |
|
5 |
+Release: 1%{?dist} |
|
6 |
+Summary: Python version extractor |
|
7 |
+License: ISC |
|
8 |
+Group: Development/Languages/Python |
|
9 |
+Url: https://github.com/habnabit/vcversioner |
|
10 |
+Source0: vcversioner-%{version}.tar.gz |
|
11 |
+%define sha1 vcversioner=ce076b62e8f0772bf79f29762bfc3cf09f6781b5 |
|
12 |
+ |
|
13 |
+BuildRequires: python2 |
|
14 |
+#BuildRequires: python2-libs |
|
15 |
+BuildRequires: python-setuptools |
|
16 |
+ |
|
17 |
+BuildArch: noarch |
|
18 |
+ |
|
19 |
+%description |
|
20 |
+Elevator pitch: you can write a setup.py with no version information specified, and vcversioner will find a recent, properly-formatted VCS tag and extract a version from it. |
|
21 |
+ |
|
22 |
+%package -n python3-vcversioner |
|
23 |
+Summary: python-vcversioner |
|
24 |
+BuildRequires: python3-devel |
|
25 |
+BuildRequires: python3-libs |
|
26 |
+BuildRequires: python3-setuptools |
|
27 |
+BuildRequires: python3-xml |
|
28 |
+ |
|
29 |
+%description -n python3-vcversioner |
|
30 |
+Python 3 version. |
|
31 |
+ |
|
32 |
+%prep |
|
33 |
+%setup -n vcversioner-%{version} |
|
34 |
+rm -rf ../p3dir |
|
35 |
+cp -a . ../p3dir |
|
36 |
+ |
|
37 |
+%build |
|
38 |
+python2 setup.py build |
|
39 |
+pushd ../p3dir |
|
40 |
+python3 setup.py build |
|
41 |
+popd |
|
42 |
+ |
|
43 |
+%install |
|
44 |
+pushd ../p3dir |
|
45 |
+python3 setup.py install --prefix=%{_prefix} --root=%{buildroot} |
|
46 |
+popd |
|
47 |
+python2 setup.py install --prefix=%{_prefix} --root=%{buildroot} |
|
48 |
+ |
|
49 |
+%check |
|
50 |
+python2 setup.py test |
|
51 |
+pushd ../p3dir |
|
52 |
+python3 setup test |
|
53 |
+popd |
|
54 |
+ |
|
55 |
+%files |
|
56 |
+%defattr(-,root,root,-) |
|
57 |
+%{python2_sitelib}/* |
|
58 |
+ |
|
59 |
+%files -n python3-vcversioner |
|
60 |
+%defattr(-,root,root) |
|
61 |
+%{python3_sitelib}/* |
|
62 |
+ |
|
63 |
+%changelog |
|
64 |
+* Tue Oct 23 2018 Sujay G <gsujay@vmware.com> 2.16.0.0-1 |
|
65 |
+- Initial version |