← Back to team overview

cloud-init-dev team mailing list archive

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

 

Scott Moser has proposed merging ~smoser/cloud-init:fix/lp-1756471-open-telekom into cloud-init:master.

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

Requested reviews:
  cloud-init commiters (cloud-init-dev)
Related bugs:
  Bug #1756471 in cloud-init: "ds-identify does not identify openstack  Open Telecom Cloud"
  https://bugs.launchpad.net/cloud-init/+bug/1756471

For more details, see:
https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/341851

see commit message
-- 
Your team cloud-init commiters is requested to review the proposed merge of ~smoser/cloud-init:fix/lp-1756471-open-telekom into cloud-init:master.
diff --git a/tests/unittests/test_ds_identify.py b/tests/unittests/test_ds_identify.py
index 9c5628e..ed654c4 100644
--- a/tests/unittests/test_ds_identify.py
+++ b/tests/unittests/test_ds_identify.py
@@ -65,6 +65,7 @@ P_SEED_DIR = "var/lib/cloud/seed"
 P_DSID_CFG = "etc/cloud/ds-identify.cfg"
 
 MOCK_VIRT_IS_KVM = {'name': 'detect_virt', 'RET': 'kvm', 'ret': 0}
+MOCK_VIRT_IS_XEN = {'name': 'detect_virt', 'RET': 'xen', 'ret': 0}
 MOCK_VIRT_IS_VMWARE = {'name': 'detect_virt', 'RET': 'vmware', 'ret': 0}
 MOCK_UNAME_IS_PPC64 = {'name': 'uname', 'out': UNAME_PPC64EL, 'ret': 0}
 
@@ -291,6 +292,10 @@ class TestDsIdentify(CiTestCase):
         """On Intel, openstack must be identified."""
         self._test_ds_found('OpenStack')
 
+    def test_openstack_open_telekom_cloud(self):
+        """Open Telecom identification."""
+        self._test_ds_found('OpenStack-OpenTelekom')
+
     def test_openstack_on_non_intel_is_maybe(self):
         """On non-Intel, openstack without dmi info is maybe.
 
@@ -502,6 +507,12 @@ VALID_CFG = {
         'policy_dmi': POLICY_FOUND_ONLY,
         'policy_no_dmi': POLICY_FOUND_ONLY,
     },
+    'OpenStack-OpenTelekom': {
+        # OTC gen1 (Xen) hosts use OpenStack datasource, LP: #1756471
+        'ds': 'OpenStack',
+        'files': {P_CHASSIS_ASSET_TAG: 'OpenTelekomCloud\n'},
+        'mocks': [MOCK_VIRT_IS_XEN],
+    },
     'OVF-seed': {
         'ds': 'OVF',
         'files': {
diff --git a/tools/ds-identify b/tools/ds-identify
index e3f93c9..e2552c8 100755
--- a/tools/ds-identify
+++ b/tools/ds-identify
@@ -894,6 +894,10 @@ dscheck_OpenStack() {
         return ${DS_FOUND}
     fi
 
+    if dmi_chassis_asset_tag_matches "OpenTelekomCloud"; then
+        return ${DS_FOUND}
+    fi
+
     # LP: #1715241 : arch other than intel are not identified properly.
     case "$DI_UNAME_MACHINE" in
         i?86|x86_64) :;;

Follow ups