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

Subscribers

People subscribed via source and target branches