← Back to team overview

cloud-init-dev team mailing list archive

[Merge] ~powersj/cloud-init:cii-image-properties into cloud-init:master

 

Joshua Powers has proposed merging ~powersj/cloud-init:cii-image-properties into cloud-init:master.

Commit message:
tests: clean up image properties

This fixes the incorrectly named 'family' value for images as 'os'.
Families are already defined in util.py:OS_FAMILY_MAPPING and a family
is a collection of OSes.

This makes the properties function part of the super class of image as
it is only overridden by the lxd backend.


Requested reviews:
  Server Team CI bot (server-team-bot): continuous-integration
  cloud-init commiters (cloud-init-dev)

For more details, see:
https://code.launchpad.net/~powersj/cloud-init/+git/cloud-init/+merge/335853
-- 
Your team cloud-init commiters is requested to review the proposed merge of ~powersj/cloud-init:cii-image-properties into cloud-init:master.
diff --git a/tests/cloud_tests/platforms/ec2/image.py b/tests/cloud_tests/platforms/ec2/image.py
index 53706b1..7bedf59 100644
--- a/tests/cloud_tests/platforms/ec2/image.py
+++ b/tests/cloud_tests/platforms/ec2/image.py
@@ -33,16 +33,6 @@ class EC2Image(Image):
             self._img_instance.start(wait=True, wait_for_cloud_init=True)
         return self._img_instance
 
-    @property
-    def properties(self):
-        """Dictionary containing: 'arch', 'os', 'version', 'release'."""
-        return {
-            'arch': self.config['arch'],
-            'os': self.config['family'],
-            'release': self.config['release'],
-            'version': self.config['version'],
-        }
-
     def destroy(self):
         """Delete the instance used to create a custom image."""
         if self._img_instance:
diff --git a/tests/cloud_tests/platforms/images.py b/tests/cloud_tests/platforms/images.py
index d503108..7ede4ed 100644
--- a/tests/cloud_tests/platforms/images.py
+++ b/tests/cloud_tests/platforms/images.py
@@ -26,7 +26,12 @@ class Image(TargetBase):
     @property
     def properties(self):
         """{} containing: 'arch', 'os', 'version', 'release'."""
-        raise NotImplementedError
+        return {
+            'arch': self.config['arch'],
+            'os': self.config['os'],
+            'release': self.config['release'],
+            'version': self.config['version'],
+        }
 
     @property
     def features(self):
diff --git a/tests/cloud_tests/platforms/nocloudkvm/image.py b/tests/cloud_tests/platforms/nocloudkvm/image.py
index 09ff2a3..bc2b6e7 100644
--- a/tests/cloud_tests/platforms/nocloudkvm/image.py
+++ b/tests/cloud_tests/platforms/nocloudkvm/image.py
@@ -35,16 +35,6 @@ class NoCloudKVMImage(Image):
 
         super(NoCloudKVMImage, self).__init__(platform, config)
 
-    @property
-    def properties(self):
-        """Dictionary containing: 'arch', 'os', 'version', 'release'."""
-        return {
-            'arch': self.config['arch'],
-            'os': self.config['family'],
-            'release': self.config['release'],
-            'version': self.config['version'],
-        }
-
     def _execute(self, command, stdin=None, env=None):
         """Execute command in image, modifying image."""
         return self.mount_image_callback(command, stdin=stdin, env=env)
diff --git a/tests/cloud_tests/releases.yaml b/tests/cloud_tests/releases.yaml
index 48f903b..0a9fa60 100644
--- a/tests/cloud_tests/releases.yaml
+++ b/tests/cloud_tests/releases.yaml
@@ -132,7 +132,7 @@ releases:
             enabled: true
             release: bionic
             version: 18.04
-            family: ubuntu
+            os: ubuntu
             feature_groups:
                 - base
                 - debian_base
@@ -148,7 +148,7 @@ releases:
             enabled: true
             release: artful
             version: 17.10
-            family: ubuntu
+            os: ubuntu
             feature_groups:
                 - base
                 - debian_base
@@ -164,7 +164,7 @@ releases:
             enabled: true
             release: zesty
             version: 17.04
-            family: ubuntu
+            os: ubuntu
             feature_groups:
                 - base
                 - debian_base
@@ -180,7 +180,7 @@ releases:
             enabled: true
             release: xenial
             version: 16.04
-            family: ubuntu
+            os: ubuntu
             feature_groups:
                 - base
                 - debian_base
@@ -196,7 +196,7 @@ releases:
             enabled: true
             release: trusty
             version: 14.04
-            family: ubuntu
+            os: ubuntu
             feature_groups:
                 - base
                 - debian_base