<feed xmlns='http://www.w3.org/2005/Atom'>
<title>vyos-cloud-init.git/tests/unittests/test_datasource/test_scaleway.py, branch rolling</title>
<subtitle> (mirror of https://github.com/vyos/vyos-cloud-init.git)
</subtitle>
<id>https://git.amelek.net/vyos/vyos-cloud-init.git/atom?h=rolling</id>
<link rel='self' href='https://git.amelek.net/vyos/vyos-cloud-init.git/atom?h=rolling'/>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/'/>
<updated>2021-12-03T20:11:46+00:00</updated>
<entry>
<title>Reorganize unit test locations under tests/unittests (#1126)</title>
<updated>2021-12-03T20:11:46+00:00</updated>
<author>
<name>Brett Holman</name>
<email>bholman.devel@gmail.com</email>
</author>
<published>2021-12-03T20:11:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=039c40f9b3d88ee8158604bb18ca4bf2fb5d5e51'/>
<id>urn:sha1:039c40f9b3d88ee8158604bb18ca4bf2fb5d5e51</id>
<content type='text'>
This attempts to standardize unit test file location under test/unittests/
such that any source file located at cloudinit/path/to/file.py may have a
corresponding unit test file at test/unittests/path/to/test_file.py.

Noteworthy Comments:
====================
Four different duplicate test files existed:
test_{gpg,util,cc_mounts,cc_resolv_conf}.py
Each of these duplicate file pairs has been merged together. This is a
break in git history for these files.

The test suite appears to have a dependency on test order. Changing test
order causes some tests to fail. This should be rectified, but for now
some tests have been modified in
tests/unittests/config/test_set_passwords.py.

A helper class name starts with "Test" which causes pytest to try
executing it as a test case, which then throws warnings "due to Class
having __init__()".  Silence by changing the name of the class.

# helpers.py is imported in many test files, import paths change
cloudinit/tests/helpers.py -&gt; tests/unittests/helpers.py

# Move directories:
cloudinit/distros/tests -&gt; tests/unittests/distros
cloudinit/cmd/devel/tests -&gt; tests/unittests/cmd/devel
cloudinit/cmd/tests -&gt; tests/unittests/cmd/
cloudinit/sources/helpers/tests -&gt; tests/unittests/sources/helpers
cloudinit/sources/tests -&gt; tests/unittests/sources
cloudinit/net/tests -&gt; tests/unittests/net
cloudinit/config/tests -&gt; tests/unittests/config
cloudinit/analyze/tests/ -&gt; tests/unittests/analyze/

# Standardize tests already in tests/unittests/
test_datasource -&gt; sources
test_distros -&gt; distros
test_vmware -&gt; sources/vmware
test_handler -&gt; config        # this contains cloudconfig module tests
test_runs -&gt; runs</content>
</entry>
<entry>
<title>tox: bump the pinned flake8 and pylint version (#1029)</title>
<updated>2021-09-21T20:28:30+00:00</updated>
<author>
<name>Paride Legovini</name>
<email>paride.legovini@canonical.com</email>
</author>
<published>2021-09-21T20:28:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=089a307db1fc572461eea1589f1876132c058311'/>
<id>urn:sha1:089a307db1fc572461eea1589f1876132c058311</id>
<content type='text'>
tox: bump the pinned flake8 and pylint version

* pylint: fix W1406 (redundant-u-string-prefix)

The u prefix for strings is no longer necessary in Python &gt;=3.0.

* pylint: disable W1514 (unspecified-encoding)
    
From https://www.python.org/dev/peps/pep-0597/ (Python 3.10):
    
The new warning stems form https://www.python.org/dev/peps/pep-0597,
which says:
    
  Developers using macOS or Linux may forget that the default encoding
  is not always UTF-8. [...] Even Python experts may assume that the
  default encoding is UTF-8. This creates bugs that only happen on Windows.
    
The warning could be fixed by always specifying encoding='utf-8',
however we should be careful to not break environments which are not
utf-8 (or explicitly state that only utf-8 is supported). Let's silence
the warning for now.

* _quick_read_instance_id: cover the case where load_yaml() returns None

Spotted by pylint:
 - E1135 (unsupported-membership-test)
 - E1136 (unsubscriptable-object)

LP: #1944414</content>
</entry>
<entry>
<title>cloudinit: move dmi functions out of util (#622)</title>
<updated>2020-11-02T20:41:11+00:00</updated>
<author>
<name>Scott Moser</name>
<email>smoser@brickies.net</email>
</author>
<published>2020-11-02T20:41:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=0af1ff1eaf593c325b4f53181a572110eb016c50'/>
<id>urn:sha1:0af1ff1eaf593c325b4f53181a572110eb016c50</id>
<content type='text'>
This just separates the reading of dmi values into its own file.

Some things of note:
 * left import of util in dmi.py only for 'is_container'
   It'd be good if is_container was not in util.
 * just the use of 'util.is_x86' to dmi.py
 * open() is used directly rather than load_file.</content>
</entry>
<entry>
<title>test: fix all flake8 E126 errors (#425)</title>
<updated>2020-06-10T14:39:29+00:00</updated>
<author>
<name>Joshua Powers</name>
<email>josh.powers@canonical.com</email>
</author>
<published>2020-06-10T14:39:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=f3bd42659efeed4b092ffcdfd5df7f24813f2d3e'/>
<id>urn:sha1:f3bd42659efeed4b092ffcdfd5df7f24813f2d3e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>test: fix all flake8 E121 and E123 errors (#404)</title>
<updated>2020-06-02T16:06:07+00:00</updated>
<author>
<name>Joshua Powers</name>
<email>josh.powers@canonical.com</email>
</author>
<published>2020-06-02T16:06:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=d53921ea3396c8301c65cad3abf04b4542d4b7a0'/>
<id>urn:sha1:d53921ea3396c8301c65cad3abf04b4542d4b7a0</id>
<content type='text'>
This fixes issues with closing brackets not matching the opening
bracket's line and continuation line under-idented for hanging indent.</content>
</entry>
<entry>
<title>Scaleway: Fix DatasourceScaleway to avoid backtrace (#128)</title>
<updated>2020-01-29T15:55:09+00:00</updated>
<author>
<name>Louis Bouchard</name>
<email>bouchard.louis@gmail.com</email>
</author>
<published>2020-01-29T15:55:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=9e3ac98097ed1c7f49ec8975a40aec7229231aae'/>
<id>urn:sha1:9e3ac98097ed1c7f49ec8975a40aec7229231aae</id>
<content type='text'>
Make sure network_config is created when self._network_config is unset.

Co-authored-by: Scott Moser &lt;smoser@brickies.net&gt;
</content>
</entry>
<entry>
<title>Revert "DataSource: move update_events from a class to an instance..."</title>
<updated>2019-04-10T20:21:37+00:00</updated>
<author>
<name>Daniel Watkins</name>
<email>daniel.watkins@canonical.com</email>
</author>
<published>2019-04-10T20:21:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=6322c2ddf4b68a8e7cc467a07fb20a1d151a2ef3'/>
<id>urn:sha1:6322c2ddf4b68a8e7cc467a07fb20a1d151a2ef3</id>
<content type='text'>
Moving update_events from a class attribute to an instance attribute
means that it doesn't exist on DataSource objects that are unpickled,
causing tracebacks on cloud-init upgrade.

As this change is only required for cloud-init installations which don't
utilise ds-identify, we're backing it out to be reintroduced once the
upgrade path bug has been addressed.

This reverts commit f2fd6eac4407e60d0e98826ab03847dda4cde138.
</content>
</entry>
<entry>
<title>DataSource: move update_events from a class to an instance attribute</title>
<updated>2019-03-14T23:06:47+00:00</updated>
<author>
<name>Daniel Watkins</name>
<email>daniel.watkins@canonical.com</email>
</author>
<published>2019-03-14T23:06:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=f2fd6eac4407e60d0e98826ab03847dda4cde138'/>
<id>urn:sha1:f2fd6eac4407e60d0e98826ab03847dda4cde138</id>
<content type='text'>
Currently, DataSourceAzure updates self.update_events in __init__. As
update_events is a class attribute on DataSource, this updates it for
all instances of classes derived from DataSource including those for
other clouds. This means that if DataSourceAzure is even instantiated,
its behaviour is applied to whichever data source ends up being used for
boot.

To address this, update_events is moved from a class attribute to an
instance attribute (that is therefore populated at instantiation time).
This retains the defaults for all DataSource sub-class instances, but
avoids them being able to mutate the state in instances of other
DataSource sub-classes.

update_events is only ever referenced on an instance of DataSource (or a
sub-class); no code relies on it being a class attribute. (In fact,
it's only used within methods on DataSource or its sub-classes, so it
doesn't even _need_ to remain public, though I think it's appropriate
for it to be public.)

DataSourceScaleway is also updated to move update_events from a
class attribute to an instance attribute, as the class attribute would
now be masked by the DataSource instance attribute.

LP: #1819913
</content>
</entry>
<entry>
<title>Scaleway: Support ssh keys provided inside an instance tag.</title>
<updated>2018-12-20T21:49:09+00:00</updated>
<author>
<name>PORTE Loïc</name>
<email>lporte@scaleway.com</email>
</author>
<published>2018-12-20T21:49:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=a809b25c959228ff612ae8e6aaae215bdc028c64'/>
<id>urn:sha1:a809b25c959228ff612ae8e6aaae215bdc028c64</id>
<content type='text'>
The change here will utilize ssh keys found inside an instance's tag.
The tag value must start with 'AUTHORIZED_KEY'.
</content>
</entry>
<entry>
<title>Scaleway: Add network configuration to the DataSource</title>
<updated>2018-08-17T18:43:44+00:00</updated>
<author>
<name>Louis Bouchard</name>
<email>lbouchard@online.net</email>
</author>
<published>2018-08-17T18:43:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=51f49dc1da0c045d01ddc977874c9bed70cb510f'/>
<id>urn:sha1:51f49dc1da0c045d01ddc977874c9bed70cb510f</id>
<content type='text'>
DEP_NETWORK is removed since the network_config must
run at each boot. New EventType.BOOT event is used
for that.

Network is brought up early to fetch the metadata which
is required to configure the network (ipv4 and/or v6).

Adds unittests for the following and fixes test_common for
LOCAL and NETWORK sets.
</content>
</entry>
</feed>
