diff options
author | Daniel Watkins <oddbloke@ubuntu.com> | 2021-01-28 10:50:23 -0500 |
---|---|---|
committer | git-ubuntu importer <ubuntu-devel-discuss@lists.ubuntu.com> | 2021-01-29 18:53:09 +0000 |
commit | 8497bb0be24312d4edea3b1307c90407fe70356d (patch) | |
tree | a6c16381d8fb074766b2f25ef48b1800c85136f8 | |
parent | 1aa70cf25156c5d403f0a62997aa6b0e56c42e93 (diff) | |
download | cloud-init-git-8497bb0be24312d4edea3b1307c90407fe70356d.tar.gz |
20.4.1-79-g71564dce-0ubuntu1 (patches unapplied)
Imported using git-ubuntu import.
26 files changed, 84 insertions, 170 deletions
@@ -1,3 +1,6 @@ +20.4.1 + - Revert "ssh_util: handle non-default AuthorizedKeysFile config (#586)" + 20.4 - tox: avoid tox testenv subsvars for xenial support (#684) - Ensure proper root permissions in integration tests (#664) [James Falcon] @@ -528,7 +531,7 @@ - docs: add additional details to per-instance/once [Joshua Powers] - Update doc-requirements.txt [Joshua Powers] - doc-requirements: add missing dep [Joshua Powers] - - dhcp: Support RedHat dhcp rfc3442 lease format for option 121 (#76) + - dhcp: Support Red Hat dhcp rfc3442 lease format for option 121 (#76) [Eric Lafontaine] (LP: #1850642) - network_state: handle empty v1 config (#45) (LP: #1852496) - docs: Add document on how to report bugs [Joshua Powers] diff --git a/HACKING.rst b/HACKING.rst index 6ce4397d..623b3136 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -98,6 +98,11 @@ The cloud-init team will review the two merge proposals and verify that the CLA has been signed for the Launchpad user and record the associated GitHub account. +.. note:: + If you are a first time contributor, you will not need to touch + Launchpad to contribute to cloud-init: all new CLA signatures are + handled as part of the GitHub pull request process described above. + Do these things for each feature or bug ======================================= diff --git a/cloud-tests-requirements.txt b/cloud-tests-requirements.txt index b4cd18d5..eecab63e 100644 --- a/cloud-tests-requirements.txt +++ b/cloud-tests-requirements.txt @@ -10,7 +10,7 @@ boto3==1.14.53 # ssh communication paramiko==2.7.2 -cryptography==3.1 +cryptography==3.2 # lxd backend pylxd==2.2.11 diff --git a/cloudinit/config/cc_resolv_conf.py b/cloudinit/config/cc_resolv_conf.py index 7beb11ca..466dad03 100644 --- a/cloudinit/config/cc_resolv_conf.py +++ b/cloudinit/config/cc_resolv_conf.py @@ -14,12 +14,12 @@ Resolv Conf This module is intended to manage resolv.conf in environments where early configuration of resolv.conf is necessary for further bootstrapping and/or where configuration management such as puppet or chef own dns configuration. -As Debian/Ubuntu will, by default, utilize resolvconf, and similarly RedHat +As Debian/Ubuntu will, by default, utilize resolvconf, and similarly Red Hat will use sysconfig, this module is likely to be of little use unless those are configured correctly. .. note:: - For RedHat with sysconfig, be sure to set PEERDNS=no for all DHCP + For Red Hat with sysconfig, be sure to set PEERDNS=no for all DHCP enabled NICs. .. note:: diff --git a/cloudinit/config/cc_rh_subscription.py b/cloudinit/config/cc_rh_subscription.py index 28d62e9d..693317c2 100644 --- a/cloudinit/config/cc_rh_subscription.py +++ b/cloudinit/config/cc_rh_subscription.py @@ -5,15 +5,15 @@ # This file is part of cloud-init. See LICENSE file for license information. """ -RedHat Subscription -------------------- +Red Hat Subscription +-------------------- **Summary:** register red hat enterprise linux based system -Register a RedHat system either by username and password *or* activation and +Register a Red Hat system either by username and password *or* activation and org. Following a sucessful registration, you can auto-attach subscriptions, set the service level, add subscriptions based on pool id, enable/disable yum repositories based on repo id, and alter the rhsm_baseurl and server-hostname -in ``/etc/rhsm/rhs.conf``. For more details, see the ``Register RedHat +in ``/etc/rhsm/rhs.conf``. For more details, see the ``Register Red Hat Subscription`` example config. **Internal name:** ``cc_rh_subscription`` diff --git a/cloudinit/sources/DataSourceOVF.py b/cloudinit/sources/DataSourceOVF.py index 94d9f1b9..bbeada0b 100644 --- a/cloudinit/sources/DataSourceOVF.py +++ b/cloudinit/sources/DataSourceOVF.py @@ -416,7 +416,7 @@ class DataSourceOVFNet(DataSourceOVF): def get_max_wait_from_cfg(cfg): - default_max_wait = 90 + default_max_wait = 15 max_wait_cfg_option = 'vmware_cust_file_max_wait' max_wait = default_max_wait diff --git a/cloudinit/version.py b/cloudinit/version.py index f25e9145..36ec728e 100644 --- a/cloudinit/version.py +++ b/cloudinit/version.py @@ -4,7 +4,7 @@ # # This file is part of cloud-init. See LICENSE file for license information. -__VERSION__ = "20.4" +__VERSION__ = "20.4.1" _PACKAGED_VERSION = '@@PACKAGED_VERSION@@' FEATURES = [ diff --git a/debian/changelog b/debian/changelog index 4f1d5b9e..a45a6164 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,22 @@ +cloud-init (20.4.1-79-g71564dce-0ubuntu1) hirsute; urgency=medium + + * New upstream snapshot. + - Release 20.4.1 (LP: #1911680) + - [VMware] change default max wait time to 15s (#774) [xiaofengw-vmware] + - Revert integration test associated with reverted #586 (#784) + - Add jordimassaguerpla as contributor (#787) [Jordi Massaguer Pla] + - Add Rick Harding to CLA signers (#792) [Rick Harding] + - HACKING.rst: add clarifying note to LP CLA process section (#789) + - Stop linting cloud_tests (#791) + - cloud-tests: update cryptography requirement (#790) [Joshua Powers] + - Remove 'remove-raise-on-failure' calls from integration_tests (#788) + - Use more cloud defaults in integration tests (#757) + - Adding self to cla signers (#776) [Andrew Bogott] + - doc: avoid two warnings (#781) [Dan Kenigsberg] + - Use proper spelling for Red Hat (#778) [Dan Kenigsberg] + + -- Daniel Watkins <oddbloke@ubuntu.com> Thu, 28 Jan 2021 10:50:23 -0500 + cloud-init (20.4-66-gad23441d-0ubuntu1) hirsute; urgency=medium * New upstream snapshot. diff --git a/doc/rtd/topics/datasources/ovf.rst b/doc/rtd/topics/datasources/ovf.rst index 6256e624..85b0c377 100644 --- a/doc/rtd/topics/datasources/ovf.rst +++ b/doc/rtd/topics/datasources/ovf.rst @@ -13,6 +13,15 @@ source code tree in doc/sources/ovf Configuration ------------- +The following configuration can be set for the datasource in system +configuration (in `/etc/cloud/cloud.cfg` or `/etc/cloud/cloud.cfg.d/`). + +The settings that may be configured are: + + * vmware_cust_file_max_wait: the maximum amount of clock time in seconds that + should be spent waiting for vmware customization files. (default: 15) + + On VMware platforms, VMTools use is required for OVF datasource configuration settings as well as vCloud and vSphere admin configuration. User could change the VMTools configuration options with command:: diff --git a/doc/rtd/topics/examples.rst b/doc/rtd/topics/examples.rst index 81860f85..97fd616d 100644 --- a/doc/rtd/topics/examples.rst +++ b/doc/rtd/topics/examples.rst @@ -149,8 +149,8 @@ Disk setup :language: yaml :linenos: -Register RedHat Subscription -============================ +Register Red Hat Subscription +============================= .. literalinclude:: ../../examples/cloud-config-rh_subscription.txt :language: yaml diff --git a/doc/rtd/topics/format.rst b/doc/rtd/topics/format.rst index d03e4caf..fa8aa925 100644 --- a/doc/rtd/topics/format.rst +++ b/doc/rtd/topics/format.rst @@ -23,9 +23,11 @@ Using a mime-multi part file, the user can specify more than one type of data. For example, both a user data script and a cloud-config type could be specified. -Supported content-types are listed from the cloud-init subcommand make-mime:: +Supported content-types are listed from the cloud-init subcommand make-mime: - % cloud-init devel make-mime --list-types +.. code-block:: shell-session + + $ cloud-init devel make-mime --list-types cloud-boothook cloud-config cloud-config-archive @@ -47,9 +49,11 @@ The cloud-init subcommand can generate MIME multi-part files: `make-mime`_. separated by a colon (e.g. ``config.yaml:cloud-config``) and emits a MIME multipart message to stdout. An example invocation, assuming you have your cloud config in ``config.yaml`` and a shell script in ``script.sh`` and want -to store the multipart message in ``user-data``:: +to store the multipart message in ``user-data``: + +.. code-block:: shell-session - % cloud-init devel make-mime -a config.yaml:cloud-config -a script.sh:x-shellscript > user-data + $ cloud-init devel make-mime -a config.yaml:cloud-config -a script.sh:x-shellscript > user-data .. _make-mime: https://github.com/canonical/cloud-init/blob/master/cloudinit/cmd/devel/make_mime.py @@ -70,7 +74,7 @@ archive. Example ------- -:: +.. code-block:: shell-session $ cat myscript.sh diff --git a/integration-requirements.txt b/integration-requirements.txt index ec765763..c959001e 100644 --- a/integration-requirements.txt +++ b/integration-requirements.txt @@ -1,5 +1,5 @@ # PyPI requirements for cloud-init integration testing # https://cloudinit.readthedocs.io/en/latest/topics/integration_tests.html # -pycloudlib @ git+https://github.com/canonical/pycloudlib.git@72e800b8e99c5b735348c4778f19f92cf6c63de0 +pycloudlib @ git+https://github.com/canonical/pycloudlib.git@878981e3c7caaf583a8c7c5494dba9d9447acee8 pytest diff --git a/tests/cloud_tests/testcases/examples/TODO.md b/tests/cloud_tests/testcases/examples/TODO.md index 8db0e98e..cde699a7 100644 --- a/tests/cloud_tests/testcases/examples/TODO.md +++ b/tests/cloud_tests/testcases/examples/TODO.md @@ -6,7 +6,7 @@ Below lists each of the issing examples and why it is not currently added. - Puppet (takes > 60 seconds to run) - Manage resolve.conf (lxd backend overrides changes) - Adding a yum repository (need centos system) - - Register RedHat Subscription (need centos system + subscription) + - Register Red Hat Subscription (need centos system + subscription) - Adjust mount points mounted (need multiple disks) - Call a url when finished (need end point) - Reboot/poweroff when finished (how to test) diff --git a/tests/integration_tests/assets/__init__.py b/tests/integration_tests/assets/__init__.py deleted file mode 100644 index 0cf27982..00000000 --- a/tests/integration_tests/assets/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -import os -from collections import namedtuple -from pathlib import Path - -ASSET_DIR = Path(os.path.dirname(os.path.realpath(__file__))) -PRIVATE_RSA_KEY_PATH = ASSET_DIR / 'test_id_rsa' -PUBLIC_RSA_KEY_PATH = ASSET_DIR / 'test_id_rsa.pub' - - -def get_test_rsa_keypair(): - with PUBLIC_RSA_KEY_PATH.open() as public_file: - public_key = public_file.read() - with PRIVATE_RSA_KEY_PATH.open() as private_file: - private_key = private_file.read() - KeyPair = namedtuple('KeyPair', 'public_rsa_key private_rsa_key') - return KeyPair(public_key, private_key) diff --git a/tests/integration_tests/assets/test_id_rsa b/tests/integration_tests/assets/test_id_rsa deleted file mode 100755 index 1ef67135..00000000 --- a/tests/integration_tests/assets/test_id_rsa +++ /dev/null @@ -1,38 +0,0 @@ ------BEGIN OPENSSH PRIVATE KEY----- -b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAA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WSA463L3aSl26cnAmv -CE++Ssusa9cIczTO7H+BsFc7MpWJKrAAAAwQDELFCX4ES/0HcVlTH3IjoRtIvPMb6lq545 -hPXwOb9ZpBmrgd5byZ0cEkjgEklNUZ9A9QIxrPNlVsB+z8QU+sV1qsExrPA9Fo8t9vFApi -u6WFR5QbIl9A2fh+2wZR2i0ftsndGdy9zA4LBiBj4EzQYYG7PEzSHIvyGGc0iaG4YCP+D0 -ljbVv47DruKa3RYv8Feuevo2hhRBRLnwah8cqXyehprqwA96WOoRXZVPgz7LQHKKAVYKWY -THmWZfry/xGEUAAAAKamFtZXNAbmV3dAE= ------END OPENSSH PRIVATE KEY----- diff --git a/tests/integration_tests/assets/test_id_rsa.pub b/tests/integration_tests/assets/test_id_rsa.pub deleted file mode 100644 index c14c3ea5..00000000 --- a/tests/integration_tests/assets/test_id_rsa.pub +++ /dev/null @@ -1 +0,0 @@ -ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCdjQD/2zz3UIqZLcIFUaAuN0SJ+Bh/zLce35MLf5qO8QhwSjF6+Aq3aZeg/Dg//lCtPhCaAbk3YmvhDl41yBnTPK2gCU3Fwz9H+ygqLjqGItICsw0SI6VWL+9t+rcO7lciJfx9kP7jGCrf6NDc8zHOoF/cBTpEAL0mP3ikEcJtoo9IV9ZTt+r8ki+6QohZyS9QKTM2JoBaineM1ITAVluop7YDXJ6x+BKkKbJyCA5U3+0ykV5WfyvPMb4snjtNKgFq/U/QUJ6BUqrmLIaEt0zhOdLdqNtIh/f5JIMwibLPOZeo/IbnPBwfzO4QjdpH0NMyaLj0eeNVfQA37rWJB/wwTP2eelQKdp6iCIjjN8lAgwoeKMZwVhHT3YGolSbLnSzbf2cUUHMIVFyYRF3KF/GusbmSkQ+WU8Y7gC4K1Hhpb3JVOp8M07Z19fnG8XxlqRQIx1Hsmia7NbT3tTzMcToQ5MhdVdq2UjVwe34p66BWuPMrZg0TUcR4YK3iXuqakBc= test@example diff --git a/tests/integration_tests/bugs/test_gh570.py b/tests/integration_tests/bugs/test_gh570.py index b8866edd..534cfb9a 100644 --- a/tests/integration_tests/bugs/test_gh570.py +++ b/tests/integration_tests/bugs/test_gh570.py @@ -34,5 +34,6 @@ def test_nocloud_seedfrom_vendordata(client: IntegrationInstance): VENDOR_DATA, ) client.execute('cloud-init clean --logs') - client.restart(raise_on_cloudinit_failure=True) + client.restart() + assert client.execute('cloud-init status').ok assert 'seeded_vendordata_test_file' in client.execute('ls /var/tmp') diff --git a/tests/integration_tests/bugs/test_gh586.py b/tests/integration_tests/bugs/test_gh586.py deleted file mode 100644 index 44b643f1..00000000 --- a/tests/integration_tests/bugs/test_gh586.py +++ /dev/null @@ -1,42 +0,0 @@ -"""Integration test for pull #586 - -If a non-default AuthorizedKeysFile is specified in /etc/ssh/sshd_config, -ensure we can still ssh as expected. -""" -import paramiko -import pytest -from io import StringIO -from tests.integration_tests.assets import get_test_rsa_keypair - - -public_rsa_key, private_rsa_key = get_test_rsa_keypair() -USER_DATA = """\ -#cloud-config -bootcmd: - - sed -i 's/#AuthorizedKeysFile.*/AuthorizedKeysFile\\ .ssh\\/authorized_keys2/' /etc/ssh/sshd_config -ssh_authorized_keys: - - {public_key} -""".format(public_key=public_rsa_key) # noqa: E501 - - -@pytest.mark.sru_2020_11 -@pytest.mark.user_data(USER_DATA) -def test_non_default_authorized_keys(client): - sshd = client.read_from_file('/etc/ssh/sshd_config') - assert 'AuthorizedKeysFile .ssh/authorized_keys2' in sshd - assert sshd.count('AuthorizedKeysFile') == 1 - - ssh_dir = client.execute('ls /home/ubuntu/.ssh').stdout - assert 'authorized_keys2' in ssh_dir - - ssh = paramiko.SSHClient() - ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) - paramiko_key = paramiko.RSAKey.from_private_key(StringIO(private_rsa_key)) - - # Will fail with paramiko.ssh_exception.AuthenticationException - # if this bug isn't fixed - ssh.connect( - client.instance.ip, - username=client.instance.username, - pkey=paramiko_key, - ) diff --git a/tests/integration_tests/bugs/test_lp1900837.py b/tests/integration_tests/bugs/test_lp1900837.py index 395cace0..fcc2b751 100644 --- a/tests/integration_tests/bugs/test_lp1900837.py +++ b/tests/integration_tests/bugs/test_lp1900837.py @@ -22,7 +22,8 @@ class TestLogPermissionsNotResetOnReboot: assert "600" == _get_log_perms(client) # Reboot - client.restart(raise_on_cloudinit_failure=True) + client.restart() + assert client.execute('cloud-init status').ok # Check that permissions are not reset on reboot assert "600" == _get_log_perms(client) diff --git a/tests/integration_tests/clouds.py b/tests/integration_tests/clouds.py index fc0a61d5..9eebb10a 100644 --- a/tests/integration_tests/clouds.py +++ b/tests/integration_tests/clouds.py @@ -135,7 +135,7 @@ class IntegrationCloud(ABC): pycloudlib_instance = self.cloud_instance.launch(**launch_kwargs) return pycloudlib_instance - def launch(self, user_data=None, launch_kwargs=None, wait=True, + def launch(self, user_data=None, launch_kwargs=None, settings=integration_settings): if launch_kwargs is None: launch_kwargs = {} @@ -147,13 +147,9 @@ class IntegrationCloud(ABC): self.settings.EXISTING_INSTANCE_ID ) return - if 'wait' in launch_kwargs: - raise Exception("Specify 'wait' directly to launch, " - "not in 'launch_kwargs'") kwargs = { 'image_id': self.image_id, 'user_data': user_data, - 'wait': False, } kwargs.update(launch_kwargs) log.info( @@ -163,11 +159,9 @@ class IntegrationCloud(ABC): ) pycloudlib_instance = self._perform_launch(kwargs) - if wait: - pycloudlib_instance.wait(raise_on_cloudinit_failure=False) log.info('Launched instance: %s', pycloudlib_instance) instance = self.get_instance(pycloudlib_instance, settings) - if wait: + if kwargs.get('wait', True): # If we aren't waiting, we can't rely on command execution here log.info( 'cloud-init version: %s', @@ -216,9 +210,6 @@ class GceCloud(IntegrationCloud): def _get_cloud_instance(self): return GCE( tag='gce-integration-test', - project=self.settings.GCE_PROJECT, - region=self.settings.GCE_REGION, - zone=self.settings.GCE_ZONE, ) @@ -246,8 +237,7 @@ class OciCloud(IntegrationCloud): def _get_cloud_instance(self): return OCI( - tag='oci-integration-test', - compartment_id=self.settings.OCI_COMPARTMENT_ID + tag='oci-integration-test' ) @@ -281,7 +271,7 @@ class _LxdIntegrationCloud(IntegrationCloud): def _perform_launch(self, launch_kwargs): launch_kwargs['inst_type'] = launch_kwargs.pop('instance_type', None) - launch_kwargs.pop('wait') + wait = launch_kwargs.pop('wait', True) release = launch_kwargs.pop('image_id') try: @@ -297,7 +287,7 @@ class _LxdIntegrationCloud(IntegrationCloud): ) if self.settings.CLOUD_INIT_SOURCE == 'IN_PLACE': self._mount_source(pycloudlib_instance) - pycloudlib_instance.start(wait=False) + pycloudlib_instance.start(wait=wait) return pycloudlib_instance diff --git a/tests/integration_tests/instances.py b/tests/integration_tests/instances.py index 4321ce07..0d1e1aef 100644 --- a/tests/integration_tests/instances.py +++ b/tests/integration_tests/instances.py @@ -56,18 +56,13 @@ class IntegrationInstance: def destroy(self): self.instance.delete() - def restart(self, raise_on_cloudinit_failure=False): + def restart(self): """Restart this instance (via cloud mechanism) and wait for boot. - This wraps pycloudlib's `BaseInstance.restart` to pass - `raise_on_cloudinit_failure=False` to `BaseInstance.wait`, mirroring - our launch behaviour. + This wraps pycloudlib's `BaseInstance.restart` """ - self.instance.restart(wait=False) - log.info("Instance restarted; waiting for boot") - self.instance.wait( - raise_on_cloudinit_failure=raise_on_cloudinit_failure - ) + log.info("Restarting instance and waiting for boot") + self.instance.restart() def execute(self, command, *, use_sudo=True) -> Result: if self.instance.username == 'root' and use_sudo is False: diff --git a/tests/integration_tests/integration_settings.py b/tests/integration_tests/integration_settings.py index 6cabf3d8..22b4fdda 100644 --- a/tests/integration_tests/integration_settings.py +++ b/tests/integration_tests/integration_settings.py @@ -88,24 +88,6 @@ PUBLIC_SSH_KEY = None KEYPAIR_NAME = None ################################################################## -# GCE SPECIFIC SETTINGS -################################################################## -# Required for GCE -GCE_PROJECT = None - -# You probably want to override these -GCE_REGION = 'us-central1' -GCE_ZONE = 'a' - -################################################################## -# OCI SPECIFIC SETTINGS -################################################################## -# Compartment-id found at -# https://console.us-phoenix-1.oraclecloud.com/a/identity/compartments -# Required for Oracle -OCI_COMPARTMENT_ID = None - -################################################################## # USER SETTINGS OVERRIDES ################################################################## # Bring in any user-file defined settings diff --git a/tests/integration_tests/modules/test_power_state_change.py b/tests/integration_tests/modules/test_power_state_change.py index 844dccfa..32dfc86d 100644 --- a/tests/integration_tests/modules/test_power_state_change.py +++ b/tests/integration_tests/modules/test_power_state_change.py @@ -27,13 +27,13 @@ def _detect_reboot(instance: IntegrationInstance): # detecting the first boot or second boot, so we also check # the logs to ensure we've booted twice. If the logs show we've # only booted once, wait until we've booted twice - instance.instance.wait(raise_on_cloudinit_failure=False) + instance.instance.wait() for _ in range(600): try: log = instance.read_from_file('/var/log/cloud-init.log') boot_count = log.count("running 'init-local'") if boot_count == 1: - instance.instance.wait(raise_on_cloudinit_failure=False) + instance.instance.wait() elif boot_count > 1: break except Exception: diff --git a/tests/integration_tests/test_upgrade.py b/tests/integration_tests/test_upgrade.py index 660d363f..233a574b 100644 --- a/tests/integration_tests/test_upgrade.py +++ b/tests/integration_tests/test_upgrade.py @@ -43,15 +43,14 @@ def _output_to_compare(instance, file_path, netcfg_path): def _restart(instance): # work around pad.lv/1908287 - try: - instance.restart(raise_on_cloudinit_failure=True) - except OSError as e: + instance.restart() + if not instance.execute('cloud-init status --wait --long').ok: for _ in range(10): time.sleep(5) result = instance.execute('cloud-init status --wait --long') if result.ok: return - raise e + raise Exception("Cloud-init didn't finish starting up") @pytest.mark.sru_2020_11 diff --git a/tools/.github-cla-signers b/tools/.github-cla-signers index 4cee82ac..689d7902 100644 --- a/tools/.github-cla-signers +++ b/tools/.github-cla-signers @@ -2,6 +2,7 @@ ader1990 ajmyyra AlexBaranowski Aman306 +andrewbogott antonyc aswinrajamannar beezly @@ -9,12 +10,14 @@ bipinbachhao BirknerAlex candlerb cawamata +dankenigsberg dermotbradley dhensby eandersson emmanuelthome izzyleung johnsonshi +jordimassaguerpla jqueuniet jsf9k landon912 @@ -23,6 +26,7 @@ lungj manuelisimo marlluslustosa matthewruffell +mitechie nishigori olivierlemasle omBratteng @@ -26,9 +26,9 @@ deps = pylint==2.6.0 # test-requirements because unit tests are now present in cloudinit tree -r{toxinidir}/test-requirements.txt - -r{toxinidir}/cloud-tests-requirements.txt -r{toxinidir}/integration-requirements.txt -commands = {envpython} -m pylint {posargs:cloudinit tests tools} +commands = {envpython} -m pylint {posargs:cloudinit tests --ignore=cloud_tests tools} + [testenv:py3] basepython = python3 @@ -123,13 +123,12 @@ commands = {envpython} -m flake8 {posargs:cloudinit/ tests/ tools/} deps = flake8 [testenv:tip-pylint] -commands = {envpython} -m pylint {posargs:cloudinit tests tools} +commands = {envpython} -m pylint {posargs:cloudinit tests --ignore=cloud_tests tools} deps = # requirements pylint # test-requirements -r{toxinidir}/test-requirements.txt - -r{toxinidir}/cloud-tests-requirements.txt -r{toxinidir}/integration-requirements.txt [testenv:citest] |