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
diff --git a/cloudinit/sources/DataSourceScaleway.py b/cloudinit/sources/DataSourceScaleway.py
index 54bfc1f..b573b38 100644
--- a/cloudinit/sources/DataSourceScaleway.py
+++ b/cloudinit/sources/DataSourceScaleway.py
@@ -171,11 +171,10 @@ def query_data_api(api_type, api_address, retries, timeout):
171171
172class DataSourceScaleway(sources.DataSource):172class DataSourceScaleway(sources.DataSource):
173 dsname = "Scaleway"173 dsname = "Scaleway"
174 update_events = {'network': [EventType.BOOT_NEW_INSTANCE, EventType.BOOT]}
174175
175 def __init__(self, sys_cfg, distro, paths):176 def __init__(self, sys_cfg, distro, paths):
176 super(DataSourceScaleway, self).__init__(sys_cfg, distro, paths)177 super(DataSourceScaleway, self).__init__(sys_cfg, distro, paths)
177 self.update_events = {
178 'network': {EventType.BOOT_NEW_INSTANCE, EventType.BOOT}}
179178
180 self.ds_cfg = util.mergemanydict([179 self.ds_cfg = util.mergemanydict([
181 util.get_cfg_by_path(sys_cfg, ["datasource", "Scaleway"], {}),180 util.get_cfg_by_path(sys_cfg, ["datasource", "Scaleway"], {}),
diff --git a/cloudinit/sources/__init__.py b/cloudinit/sources/__init__.py
index 1604932..e6966b3 100644
--- a/cloudinit/sources/__init__.py
+++ b/cloudinit/sources/__init__.py
@@ -164,6 +164,9 @@ class DataSource(object):
164 # A datasource which supports writing network config on each system boot164 # A datasource which supports writing network config on each system boot
165 # would call update_events['network'].add(EventType.BOOT).165 # would call update_events['network'].add(EventType.BOOT).
166166
167 # Default: generate network config on new instance id (first boot).
168 update_events = {'network': set([EventType.BOOT_NEW_INSTANCE])}
169
167 # N-tuple listing default values for any metadata-related class170 # N-tuple listing default values for any metadata-related class
168 # attributes cached on an instance by a process_data runs. These attribute171 # attributes cached on an instance by a process_data runs. These attribute
169 # values are reset via clear_cached_attrs during any update_metadata call.172 # values are reset via clear_cached_attrs during any update_metadata call.
@@ -188,9 +191,6 @@ class DataSource(object):
188 self.vendordata = None191 self.vendordata = None
189 self.vendordata_raw = None192 self.vendordata_raw = None
190193
191 # Default: generate network config on new instance id (first boot).
192 self.update_events = {'network': {EventType.BOOT_NEW_INSTANCE}}
193
194 self.ds_cfg = util.get_cfg_by_path(194 self.ds_cfg = util.get_cfg_by_path(
195 self.sys_cfg, ("datasource", self.dsname), {})195 self.sys_cfg, ("datasource", self.dsname), {})
196 if not self.ds_cfg:196 if not self.ds_cfg:
diff --git a/cloudinit/sources/tests/test_init.py b/cloudinit/sources/tests/test_init.py
index cb1912b..6378e98 100644
--- a/cloudinit/sources/tests/test_init.py
+++ b/cloudinit/sources/tests/test_init.py
@@ -575,21 +575,6 @@ class TestDataSource(CiTestCase):
575 " events: New instance first boot",575 " events: New instance first boot",
576 self.logs.getvalue())576 self.logs.getvalue())
577577
578 def test_data_sources_cant_mutate_update_events_for_others(self):
579 """update_events shouldn't be changed for other DSes (LP: #1819913)"""
580
581 class ModifyingDS(DataSource):
582
583 def __init__(self, sys_cfg, distro, paths):
584 # This mirrors what DataSourceAzure does which causes LP:
585 # #1819913
586 DataSource.__init__(self, sys_cfg, distro, paths)
587 self.update_events['network'].add(EventType.BOOT)
588
589 before_update_events = copy.deepcopy(self.datasource.update_events)
590 ModifyingDS(self.sys_cfg, self.distro, self.paths)
591 self.assertEqual(before_update_events, self.datasource.update_events)
592
593578
594class TestRedactSensitiveData(CiTestCase):579class TestRedactSensitiveData(CiTestCase):
595580
diff --git a/debian/changelog b/debian/changelog
index f869278..0630854 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
1cloud-init (18.5-62-g6322c2dd-0ubuntu1) disco; urgency=medium
2
3 * New upstream snapshot.
4 - Revert "DataSource: move update_events from a class to an instance..."
5
6 -- Daniel Watkins <oddbloke@ubuntu.com> Wed, 10 Apr 2019 16:23:25 -0400
7
1cloud-init (18.5-61-gb76714c3-0ubuntu1) disco; urgency=medium8cloud-init (18.5-61-gb76714c3-0ubuntu1) disco; urgency=medium
29
3 * New upstream snapshot.10 * New upstream snapshot.
diff --git a/tests/unittests/test_datasource/test_scaleway.py b/tests/unittests/test_datasource/test_scaleway.py
index 3bfd752..f96bf0a 100644
--- a/tests/unittests/test_datasource/test_scaleway.py
+++ b/tests/unittests/test_datasource/test_scaleway.py
@@ -7,7 +7,6 @@ import requests
77
8from cloudinit import helpers8from cloudinit import helpers
9from cloudinit import settings9from cloudinit import settings
10from cloudinit.event import EventType
11from cloudinit.sources import DataSourceScaleway10from cloudinit.sources import DataSourceScaleway
1211
13from cloudinit.tests.helpers import mock, HttprettyTestCase, CiTestCase12from cloudinit.tests.helpers import mock, HttprettyTestCase, CiTestCase
@@ -404,9 +403,3 @@ class TestDataSourceScaleway(HttprettyTestCase):
404403
405 netcfg = self.datasource.network_config404 netcfg = self.datasource.network_config
406 self.assertEqual(netcfg, '0xdeadbeef')405 self.assertEqual(netcfg, '0xdeadbeef')
407
408 def test_update_events_is_correct(self):
409 """ensure update_events contains correct data"""
410 self.assertEqual(
411 {'network': {EventType.BOOT_NEW_INSTANCE, EventType.BOOT}},
412 self.datasource.update_events)

Subscribers

People subscribed via source and target branches