← Back to team overview

cloud-init-dev team mailing list archive

Re: [Merge] ~smoser/cloud-init:cleanup/test-more-files-collect into cloud-init:master

 

Add a comment that you switched to using /bin/sh instead of bash in several scripts.  Some comments inline.

Diff comments:

> diff --git a/tests/cloud_tests/platforms/lxd/instance.py b/tests/cloud_tests/platforms/lxd/instance.py
> index 0d697c0..e9b76a6 100644
> --- a/tests/cloud_tests/platforms/lxd/instance.py
> +++ b/tests/cloud_tests/platforms/lxd/instance.py
> @@ -29,6 +31,7 @@ class LXDInstance(Instance):
>              platform, name, properties, config, features)
>          self.tmpd = mkdtemp(prefix="%s-%s" % (type(self).__name__, name))

is it worth moving the self.name = name up and referencing that instead of the type(self).__name__ ?  If those are equivalent.

>          self._setup_console_log()
> +        self.name = name
>  
>      @property
>      def pylxd_container(self):
> diff --git a/tests/cloud_tests/testcases/base.py b/tests/cloud_tests/testcases/base.py
> index 1c5b540..2e0db73 100644
> --- a/tests/cloud_tests/testcases/base.py
> +++ b/tests/cloud_tests/testcases/base.py
> @@ -30,12 +30,14 @@ class CloudTestCase(unittest.TestCase):
>              raise AssertionError('Key "{}" not in cloud config'.format(name))
>          return self.cloud_config[name]
>  
> -    def get_data_file(self, name):
> +    def get_data_file(self, name, decode=True):
>          """Get data file failing test if it is not present."""
>          if name not in self.data:
>              raise AssertionError('File "{}" missing from collect data'
>                                   .format(name))
> -        return self.data[name]
> +        if not decode:
> +            return self.data[name]
> +        return self.data[name].decode()

Don't we need an encoding (utf-8) ? or is this just bytes to str ?

>  
>      def get_instance_id(self):
>          """Get recorded instance id."""


-- 
https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/336498
Your team cloud-init commiters is requested to review the proposed merge of ~smoser/cloud-init:cleanup/test-more-files-collect into cloud-init:master.


References