Merge ~chad.smith/cloud-init:ubuntu/artful into cloud-init:ubuntu/artful

Proposed by Chad Smith
Status: Rejected
Rejected by: Scott Moser
Proposed branch: ~chad.smith/cloud-init:ubuntu/artful
Merge into: cloud-init:ubuntu/artful
Diff against target: 94 lines (+74/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/cpick-3cee0bf8-oracle-fix-detect_openstack-to-report-True-on (+66/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve
cloud-init Commiters Pending
Review via email: mp+351937@code.launchpad.net

Commit message

Cherry pick fix for Oracle cloud detection for release into Artful LP: #1784685

To post a comment you must log in.
Revision history for this message
Scott Moser (smoser) wrote :
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

PASSED: Continuous integration, rev:d30a620708b33039cdd7958482bf642a35de6035
https://jenkins.ubuntu.com/server/job/cloud-init-ci/182/
Executed test runs:
    SUCCESS: Checkout
    SUCCESS: Unit & Style Tests
    SUCCESS: Ubuntu LTS: Build
    SUCCESS: Ubuntu LTS: Integration
    SUCCESS: MAAS Compatability Testing
    IN_PROGRESS: Declarative: Post Actions

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

review: Approve (continuous-integration)

Unmerged commits

d30a620... by Chad Smith

releasing cloud-init version 18.3-9-g2e62cb8a-0ubuntu1~17.10.2

63fd168... by Chad Smith

update changelog

a5b4988... by Chad Smith

cherry pick 3cee0bf8

LP: #1784685

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/changelog b/debian/changelog
index f7d3436..5e3125d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
1cloud-init (18.3-9-g2e62cb8a-0ubuntu1~17.10.2) artful-proposed; urgency=medium
2
3 * cherry-pick 3cee0bf8: oracle: fix detect_openstack to report True on
4 (LP: #1784685)
5
6 -- Chad Smith <chad.smith@canonical.com> Tue, 31 Jul 2018 13:52:27 -0600
7
1cloud-init (18.3-9-g2e62cb8a-0ubuntu1~17.10.1) artful-proposed; urgency=medium8cloud-init (18.3-9-g2e62cb8a-0ubuntu1~17.10.1) artful-proposed; urgency=medium
29
3 * New upstream snapshot. (LP: #1777912)10 * New upstream snapshot. (LP: #1777912)
diff --git a/debian/patches/cpick-3cee0bf8-oracle-fix-detect_openstack-to-report-True-on b/debian/patches/cpick-3cee0bf8-oracle-fix-detect_openstack-to-report-True-on
4new file mode 10064411new file mode 100644
index 0000000..7518cb0
--- /dev/null
+++ b/debian/patches/cpick-3cee0bf8-oracle-fix-detect_openstack-to-report-True-on
@@ -0,0 +1,66 @@
1From 3cee0bf85fbf12d272422c8eeed63bf06e64570b Mon Sep 17 00:00:00 2001
2From: Chad Smith <chad.smith@canonical.com>
3Date: Tue, 31 Jul 2018 18:44:12 +0000
4Subject: [PATCH] oracle: fix detect_openstack to report True on
5 OracleCloud.com DMI data
6
7The OpenStack datasource in 18.3 changed to detect data in the
8init-local stage instead of init-network and attempted to redetect
9OpenStackLocal datasource on Oracle across reboots. The function
10detect_openstack was added to quickly detect whether a platform is
11OpenStack based on dmi product_name or chassis_asset_tag and it was
12a bit too strict for Oracle in checking for 'OpenStack Nova'/'Compute'
13DMI product_name.
14
15Oracle's DMI product_name reports 'SAtandard PC (i440FX + PIIX, 1996)'
16and DMI chassis_asset_tag is 'OracleCloud.com'.
17
18detect_openstack function now adds 'OracleCloud.com' as a supported value
19'OracleCloud.com' to valid chassis-asset-tags for the OpenStack
20datasource.
21
22LP: #1784685
23---
24 cloudinit/sources/DataSourceOpenStack.py | 3 ++-
25 .../test_datasource/test_openstack.py | 18 ++++++++++++++++++
26 2 files changed, 20 insertions(+), 1 deletion(-)
27
28--- a/cloudinit/sources/DataSourceOpenStack.py
29+++ b/cloudinit/sources/DataSourceOpenStack.py
30@@ -28,7 +28,8 @@ DMI_PRODUCT_NOVA = 'OpenStack Nova'
31 DMI_PRODUCT_COMPUTE = 'OpenStack Compute'
32 VALID_DMI_PRODUCT_NAMES = [DMI_PRODUCT_NOVA, DMI_PRODUCT_COMPUTE]
33 DMI_ASSET_TAG_OPENTELEKOM = 'OpenTelekomCloud'
34-VALID_DMI_ASSET_TAGS = [DMI_ASSET_TAG_OPENTELEKOM]
35+DMI_ASSET_TAG_ORACLE_CLOUD = 'OracleCloud.com'
36+VALID_DMI_ASSET_TAGS = [DMI_ASSET_TAG_OPENTELEKOM, DMI_ASSET_TAG_ORACLE_CLOUD]
37
38
39 class DataSourceOpenStack(openstack.SourceMixin, sources.DataSource):
40--- a/tests/unittests/test_datasource/test_openstack.py
41+++ b/tests/unittests/test_datasource/test_openstack.py
42@@ -511,6 +511,24 @@ class TestDetectOpenStack(test_helpers.C
43 ds.detect_openstack(),
44 'Expected detect_openstack == True on OpenTelekomCloud')
45
46+ @test_helpers.mock.patch(MOCK_PATH + 'util.read_dmi_data')
47+ def test_detect_openstack_oraclecloud_chassis_asset_tag(self, m_dmi,
48+ m_is_x86):
49+ """Return True on OpenStack reporting Oracle cloud asset-tag."""
50+ m_is_x86.return_value = True
51+
52+ def fake_dmi_read(dmi_key):
53+ if dmi_key == 'system-product-name':
54+ return 'Standard PC (i440FX + PIIX, 1996)' # No match
55+ if dmi_key == 'chassis-asset-tag':
56+ return 'OracleCloud.com'
57+ assert False, 'Unexpected dmi read of %s' % dmi_key
58+
59+ m_dmi.side_effect = fake_dmi_read
60+ self.assertTrue(
61+ ds.detect_openstack(),
62+ 'Expected detect_openstack == True on OracleCloud.com')
63+
64 @test_helpers.mock.patch(MOCK_PATH + 'util.get_proc_env')
65 @test_helpers.mock.patch(MOCK_PATH + 'util.read_dmi_data')
66 def test_detect_openstack_by_proc_1_environ(self, m_dmi, m_proc_env,
diff --git a/debian/patches/series b/debian/patches/series
index 2ce72fb..3691601 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
1openstack-no-network-config.patch1openstack-no-network-config.patch
2cpick-3cee0bf8-oracle-fix-detect_openstack-to-report-True-on

Subscribers

People subscribed via source and target branches