Merge ~smoser/cloud-init:fix/lp-1756471-open-telekom into cloud-init:master

Proposed by Scott Moser
Status: Merged
Approved by: Chad Smith
Approved revision: f52a0bc5f105083dc93a93f405bd3f304cdefa59
Merge reported by: Chad Smith
Merged at revision: 7713713265224d9f34410028de6bd50d1451aed9
Proposed branch: ~smoser/cloud-init:fix/lp-1756471-open-telekom
Merge into: cloud-init:master
Diff against target: 51 lines (+15/-0)
2 files modified
tests/unittests/test_ds_identify.py (+11/-0)
tools/ds-identify (+4/-0)
Reviewer Review Type Date Requested Status
Chad Smith Approve
Server Team CI bot continuous-integration Approve
Review via email: mp+341851@code.launchpad.net

Commit message

Identify OpenTelekomCloud Xen as OpenStack DS.

Open Telekom Cloud gen1 (Xen) hosts do not provide nova product
names in DMI but Xen HVM domU. They can however be safely identified
by the OpenTelekomCloud Chassis asset tag. OpenTelekomCloud does
use the network OpenStack DataSource, so we better detect it.

LP: #1756471

Description of the change

see commit message

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

PASSED: Continuous integration, rev:c373bb2d5e28503dca1176a70e392d32ae0c4fb7
https://jenkins.ubuntu.com/server/job/cloud-init-ci/902/
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/902/rebuild

review: Approve (continuous-integration)
Revision history for this message
Scott Moser (smoser) wrote :
Revision history for this message
Chad Smith (chad.smith) :
Revision history for this message
Scott Moser (smoser) :
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

PASSED: Continuous integration, rev:f52a0bc5f105083dc93a93f405bd3f304cdefa59
https://jenkins.ubuntu.com/server/job/cloud-init-ci/904/
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/904/rebuild

review: Approve (continuous-integration)
Revision history for this message
Chad Smith (chad.smith) wrote :

Thanks for the response. +1 Unit tests are good for documentation of the intent/environment under test.

review: Approve
Revision history for this message
Chad Smith (chad.smith) wrote :

An upstream commit landed for this bug.

To view that commit see the following URL:
https://git.launchpad.net/cloud-init/commit/?id=77137132

There was an error fetching revisions from git servers. Please try again in a few minutes. If the problem persists, contact Launchpad support.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/tests/unittests/test_ds_identify.py b/tests/unittests/test_ds_identify.py
2index 9c5628e..85999b7 100644
3--- a/tests/unittests/test_ds_identify.py
4+++ b/tests/unittests/test_ds_identify.py
5@@ -66,6 +66,7 @@ P_DSID_CFG = "etc/cloud/ds-identify.cfg"
6
7 MOCK_VIRT_IS_KVM = {'name': 'detect_virt', 'RET': 'kvm', 'ret': 0}
8 MOCK_VIRT_IS_VMWARE = {'name': 'detect_virt', 'RET': 'vmware', 'ret': 0}
9+MOCK_VIRT_IS_XEN = {'name': 'detect_virt', 'RET': 'xen', 'ret': 0}
10 MOCK_UNAME_IS_PPC64 = {'name': 'uname', 'out': UNAME_PPC64EL, 'ret': 0}
11
12
13@@ -291,6 +292,10 @@ class TestDsIdentify(CiTestCase):
14 """On Intel, openstack must be identified."""
15 self._test_ds_found('OpenStack')
16
17+ def test_openstack_open_telekom_cloud(self):
18+ """Open Telecom identification."""
19+ self._test_ds_found('OpenStack-OpenTelekom')
20+
21 def test_openstack_on_non_intel_is_maybe(self):
22 """On non-Intel, openstack without dmi info is maybe.
23
24@@ -502,6 +507,12 @@ VALID_CFG = {
25 'policy_dmi': POLICY_FOUND_ONLY,
26 'policy_no_dmi': POLICY_FOUND_ONLY,
27 },
28+ 'OpenStack-OpenTelekom': {
29+ # OTC gen1 (Xen) hosts use OpenStack datasource, LP: #1756471
30+ 'ds': 'OpenStack',
31+ 'files': {P_CHASSIS_ASSET_TAG: 'OpenTelekomCloud\n'},
32+ 'mocks': [MOCK_VIRT_IS_XEN],
33+ },
34 'OVF-seed': {
35 'ds': 'OVF',
36 'files': {
37diff --git a/tools/ds-identify b/tools/ds-identify
38index e3f93c9..e2552c8 100755
39--- a/tools/ds-identify
40+++ b/tools/ds-identify
41@@ -894,6 +894,10 @@ dscheck_OpenStack() {
42 return ${DS_FOUND}
43 fi
44
45+ if dmi_chassis_asset_tag_matches "OpenTelekomCloud"; then
46+ return ${DS_FOUND}
47+ fi
48+
49 # LP: #1715241 : arch other than intel are not identified properly.
50 case "$DI_UNAME_MACHINE" in
51 i?86|x86_64) :;;

Subscribers

People subscribed via source and target branches