Merge ~oddbloke/cloud-init/+git/cloud-init:ubuntu/devel into cloud-init:ubuntu/devel

Proposed by Dan Watkins
Status: Merged
Merged at revision: 8324a10706100364f45c5486fc4cb04fdba71bdd
Proposed branch: ~oddbloke/cloud-init/+git/cloud-init:ubuntu/devel
Merge into: cloud-init:ubuntu/devel
Diff against target: 104 lines (+11/-27)
5 files modified
cloudinit/sources/DataSourceScaleway.py (+1/-2)
cloudinit/sources/__init__.py (+3/-3)
cloudinit/sources/tests/test_init.py (+0/-15)
debian/changelog (+7/-0)
tests/unittests/test_datasource/test_scaleway.py (+0/-7)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Needs Fixing
Ryan Harper Approve
Review via email: mp+365823@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Ryan Harper (raharper) wrote :

Looks good.

(neipa) cloud-init % ~/work/git/uss-tableflip/scripts/new-upstream-snapshot upstream/master
diff --git a/debian/changelog b/debian/changelog
index f869278..8d3a8ee 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+cloud-init (18.5-62-g6322c2dd-0ubuntu1) UNRELEASED; urgency=medium
+
+ * New upstream snapshot.
+ - Revert "DataSource: move update_events from a class to an instance..."
+
+ -- Ryan Harper <email address hidden> Wed, 10 Apr 2019 15:32:32 -0500
+
 cloud-init (18.5-61-gb76714c3-0ubuntu1) disco; urgency=medium

   * New upstream snapshot.
Commit this change? (Y/n): y
[ubuntu/devel e3a170b] update changelog (New upstream snapshot 18.5-62-g6322c2dd).
 1 file changed, 7 insertions(+)
wrote new-upstream-changes.txt for cloud-init version 18.5-62-g6322c2dd-0ubuntu1.
release with:
sed -i -e "1s/UNRELEASED/disco/" debian/changelog
git commit -m "releasing cloud-init version 18.5-62-g6322c2dd-0ubuntu1" debian/changelog
git tag ubuntu/18.5-62-g6322c2dd-0ubuntu1
# optionally push your tag: git push <remote> ubuntu/18.5-62-g6322c2dd-0ubuntu1
(neipa) cloud-init % sed -i -e "1s/UNRELEASED/disco/" debian/changelog
(neipa) cloud-init % git commit -m "releasing cloud-init version 18.5-62-g6322c2dd-0ubuntu1" debian/changelog
[ubuntu/devel 953cc5c] releasing cloud-init version 18.5-62-g6322c2dd-0ubuntu1
 1 file changed, 1 insertion(+), 1 deletion(-)
(neipa) cloud-init % git tag ubuntu/18.5-62-g6322c2dd-0ubuntu1
(neipa) cloud-init % git fetch oddbloke
X11 forwarding request failed on channel 0
remote: Counting objects: 11, done.
remote: Compressing objects: 100% (11/11), done.
remote: Total 11 (delta 7), reused 0 (delta 0)
Unpacking objects: 100% (11/11), done.
From git.launchpad.net:~daniel-thewatkins/cloud-init/+git/cloud-init
 * [new branch] revert -> oddbloke/revert
   6380e13..8324a10 ubuntu/devel -> oddbloke/ubuntu/devel
(neipa) cloud-init %
(neipa) cloud-init % git diff oddbloke/ubuntu/devel
diff --git a/debian/changelog b/debian/changelog
index 0630854..824a7ef 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,7 +3,7 @@ cloud-init (18.5-62-g6322c2dd-0ubuntu1) disco; urgency=medium
   * New upstream snapshot.
     - Revert "DataSource: move update_events from a class to an instance..."

- -- Daniel Watkins <email address hidden> Wed, 10 Apr 2019 16:23:25 -0400
+ -- Ryan Harper <email address hidden> Wed, 10 Apr 2019 15:32:32 -0500

 cloud-init (18.5-61-gb76714c3-0ubuntu1) disco; urgency=medium

review: Approve
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

FAILED: Continuous integration, rev:8324a10706100364f45c5486fc4cb04fdba71bdd
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~daniel-thewatkins/cloud-init/+git/cloud-init/+merge/365823/+edit-commit-message

https://jenkins.ubuntu.com/server/job/cloud-init-ci/676/
Executed test runs:
    SUCCESS: Checkout
    SUCCESS: Unit & Style Tests
    SUCCESS: Ubuntu LTS: Build
    SUCCESS: Ubuntu LTS: Integration
    IN_PROGRESS: Declarative: Post Actions

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/676/rebuild

review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/cloudinit/sources/DataSourceScaleway.py b/cloudinit/sources/DataSourceScaleway.py
2index 54bfc1f..b573b38 100644
3--- a/cloudinit/sources/DataSourceScaleway.py
4+++ b/cloudinit/sources/DataSourceScaleway.py
5@@ -171,11 +171,10 @@ def query_data_api(api_type, api_address, retries, timeout):
6
7 class DataSourceScaleway(sources.DataSource):
8 dsname = "Scaleway"
9+ update_events = {'network': [EventType.BOOT_NEW_INSTANCE, EventType.BOOT]}
10
11 def __init__(self, sys_cfg, distro, paths):
12 super(DataSourceScaleway, self).__init__(sys_cfg, distro, paths)
13- self.update_events = {
14- 'network': {EventType.BOOT_NEW_INSTANCE, EventType.BOOT}}
15
16 self.ds_cfg = util.mergemanydict([
17 util.get_cfg_by_path(sys_cfg, ["datasource", "Scaleway"], {}),
18diff --git a/cloudinit/sources/__init__.py b/cloudinit/sources/__init__.py
19index 1604932..e6966b3 100644
20--- a/cloudinit/sources/__init__.py
21+++ b/cloudinit/sources/__init__.py
22@@ -164,6 +164,9 @@ class DataSource(object):
23 # A datasource which supports writing network config on each system boot
24 # would call update_events['network'].add(EventType.BOOT).
25
26+ # Default: generate network config on new instance id (first boot).
27+ update_events = {'network': set([EventType.BOOT_NEW_INSTANCE])}
28+
29 # N-tuple listing default values for any metadata-related class
30 # attributes cached on an instance by a process_data runs. These attribute
31 # values are reset via clear_cached_attrs during any update_metadata call.
32@@ -188,9 +191,6 @@ class DataSource(object):
33 self.vendordata = None
34 self.vendordata_raw = None
35
36- # Default: generate network config on new instance id (first boot).
37- self.update_events = {'network': {EventType.BOOT_NEW_INSTANCE}}
38-
39 self.ds_cfg = util.get_cfg_by_path(
40 self.sys_cfg, ("datasource", self.dsname), {})
41 if not self.ds_cfg:
42diff --git a/cloudinit/sources/tests/test_init.py b/cloudinit/sources/tests/test_init.py
43index cb1912b..6378e98 100644
44--- a/cloudinit/sources/tests/test_init.py
45+++ b/cloudinit/sources/tests/test_init.py
46@@ -575,21 +575,6 @@ class TestDataSource(CiTestCase):
47 " events: New instance first boot",
48 self.logs.getvalue())
49
50- def test_data_sources_cant_mutate_update_events_for_others(self):
51- """update_events shouldn't be changed for other DSes (LP: #1819913)"""
52-
53- class ModifyingDS(DataSource):
54-
55- def __init__(self, sys_cfg, distro, paths):
56- # This mirrors what DataSourceAzure does which causes LP:
57- # #1819913
58- DataSource.__init__(self, sys_cfg, distro, paths)
59- self.update_events['network'].add(EventType.BOOT)
60-
61- before_update_events = copy.deepcopy(self.datasource.update_events)
62- ModifyingDS(self.sys_cfg, self.distro, self.paths)
63- self.assertEqual(before_update_events, self.datasource.update_events)
64-
65
66 class TestRedactSensitiveData(CiTestCase):
67
68diff --git a/debian/changelog b/debian/changelog
69index f869278..0630854 100644
70--- a/debian/changelog
71+++ b/debian/changelog
72@@ -1,3 +1,10 @@
73+cloud-init (18.5-62-g6322c2dd-0ubuntu1) disco; urgency=medium
74+
75+ * New upstream snapshot.
76+ - Revert "DataSource: move update_events from a class to an instance..."
77+
78+ -- Daniel Watkins <oddbloke@ubuntu.com> Wed, 10 Apr 2019 16:23:25 -0400
79+
80 cloud-init (18.5-61-gb76714c3-0ubuntu1) disco; urgency=medium
81
82 * New upstream snapshot.
83diff --git a/tests/unittests/test_datasource/test_scaleway.py b/tests/unittests/test_datasource/test_scaleway.py
84index 3bfd752..f96bf0a 100644
85--- a/tests/unittests/test_datasource/test_scaleway.py
86+++ b/tests/unittests/test_datasource/test_scaleway.py
87@@ -7,7 +7,6 @@ import requests
88
89 from cloudinit import helpers
90 from cloudinit import settings
91-from cloudinit.event import EventType
92 from cloudinit.sources import DataSourceScaleway
93
94 from cloudinit.tests.helpers import mock, HttprettyTestCase, CiTestCase
95@@ -404,9 +403,3 @@ class TestDataSourceScaleway(HttprettyTestCase):
96
97 netcfg = self.datasource.network_config
98 self.assertEqual(netcfg, '0xdeadbeef')
99-
100- def test_update_events_is_correct(self):
101- """ensure update_events contains correct data"""
102- self.assertEqual(
103- {'network': {EventType.BOOT_NEW_INSTANCE, EventType.BOOT}},
104- self.datasource.update_events)

Subscribers

People subscribed via source and target branches