summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-05-25Travis: do not install python3-contextlib2 (dropped dependency) (#388)Paride Legovini
2020-05-22HACKING: mention that .github-cla-signers is alpha-sorted (#380)Daniel Watkins
Hopefully this will save some ~pointless round trips on CLA PRs.
2020-05-22Add bipinbachhao as contributor (#379)Bipin Bachhao
2020-05-21cc_snap: validate that assertions property values are strings (#370)Daniel Watkins
And add an example of providing a list of assertions.
2020-05-21conftest: implement partial disable_subp_usage (#371)Daniel Watkins
This allows tests to be configured to permit some commands to be run via util.subp, while still rejecting any unexpected calls. See the documentation for further details.
2020-05-19test_resolv_conf: refresh stale comment (#374)Daniel Watkins
2020-05-18cc_snap: apply validation to snap.commands properties (#364)Daniel Watkins
Specifically, ensure that given values are either strings, or arrays of strings.
2020-05-18make finding libc platform independent (#366)Mina Galić (deprecated: Igor Galić)
and slower. and since we're making it slower, let's cache it, in case boottime gets called more than once.
2020-05-15doc/rtd/topics/faq: Updates LXD docs links to current site (#368)TomP
We are longer using lxd.readthedocs.io Signed-off-by: Thomas Parrott thomas.parrott@canonical.com
2020-05-14templater: drop Jinja Python 2 compatibility shim (#353)Daniel Watkins
2020-05-14cloudinit: minor pylint fixes (#360)Daniel Watkins
We recently discovered that pylint is failing to report some errors when invoked across our entire codebase (see https://github.com/PyCQA/pylint/issues/3611). I've run pylint across every Python file under cloudinit/[0], and this commit fixes the issues so-discovered. [0] find cloudinit/ -name "*.py" | xargs -n 1 -t .tox/pylint/bin/python -m pylint
2020-05-14cloudinit: remove unneeded __future__ imports (#362)Daniel Watkins
We live in the future now.
2020-05-14migrating momousta lp user to Moustafa-Moustafa GitHub user (#361)Moustafa Moustafa
2020-05-14cloud_tests: emit dots on Travis while fetching images (#347)Daniel Watkins
This ensures that Travis will not kill our tests if fetching images is taking a long time. In implementation terms, this introduces a context manager which will spin up a multiprocessing.Process in the background and print a dot to stdout every 10 seconds. The process is terminated when the context manager exits. This also drop the use of travis_wait, which was being used to work around this issue.
2020-05-13Add schema to apt configure config (#357)lucasmoura
Create a schema object for the `apt_configure` module and validate this schema in the `handle` function of the module. There are some considerations regarding this PR: * The `primary` and `security` keys have the exact same properties. I tried to eliminate this redundancy by moving their properties to a common place and then just referencing it for both security and primary. Similar to what is documented here: https://json-schema.org/understanding-json-schema/structuring.html under the `Reuse` paragraph. However, this approach does not work, because the `#` pointer goes to the beginning of the file, which is a python module instead of a json file, not allowing the pointer to find the correct definition. What I did was to create a separate dict for the mirror config and reuse it for primary and security, but maybe there are better approaches to do that. * There was no documentation for the config `debconf_selections`. I tried to infer what it supposed to do by looking at the code and the `debconf-set-selections` manpage, but my description may not be accurate or complete. * Add a _parse_description function to schema.py to render multi-line preformatted content instead of squashing all whitespace LP: #1858884
2020-05-12conftest: add docs and tests regarding CiTestCase's subp functionality (#343)Daniel Watkins
And raise TypeError when subp called with no args, which more accurately mirrors normal behaviour: >>> from cloudinit.util import subp >>> subp() Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: subp() missing 1 required positional argument: 'args'
2020-05-11analyze/dump: refactor shared string into variable (#350)Daniel Watkins
2020-05-11doc: update boot.rst with correct timing of runcmd (#351)Daniel Watkins
2020-05-11HACKING.rst: change contact info to Rick Harding (#359)lucasmoura
2020-05-11HACKING.rst: guide people to add themselves to the CLA file (#349)Daniel Watkins
This (a) gives people an easy way of getting a commit into the codebase, and (b) saves us from having to explain this process (or do it ourselves) for every new contributor.
2020-05-11HACKING.rst: more unit testing documentation (#354)Daniel Watkins
Specifically: * include warning against general use of mock assert methods (and suggestions on how to replace them) * add guidelines on test decorator/param ordering * add test guideline for module-level mock variables
2020-05-08.travis.yml: don't run lintian during integration test package builds (#352)Daniel Watkins
As we only look at these logs when there's an error, and lintian failures don't cause the package build to error out, we never examine this lintian output. Let's save ourselves some CI time by skipping it. (We aren't lintian clean, otherwise a better change here would be to make lintian warnings cause the package build to fail.)
2020-05-08Add test to ensure docs examples are valid cloud-init configs (#355)James Falcon
Also update all examples to include the cloud-config header if they don't have it LP: #1876414
2020-05-07make suse and sles support 127.0.1.1 (#336)chengcheng-chcheng
Move from 127.0.0.1 to 127.0.1.1 for localhost IP addr for opensuse and sles
2020-05-07lp-to-git-users: adding chengcheng-chcheng (#356)chengcheng-chcheng
Mapped from chcheng
2020-05-06Create tests to validate schema examples (#348)lucasmoura
Add a unit test to validate if the examples provided in the config modules are conforming to the concatenated schema of all config modules. The rationale behind that is not only to verify if the examples are correctly written but to assert that no config schema is interfering with each other. Failures in validate_cloudconfig_schema raise the SchemaValidationError by using strict=True, so I have only called the function passing the right schema examples to validate. This branch also fixes an invalid schema example in cc_snap. LP: #1876412
2020-05-06analyze/dump: add support for Amazon Linux 2 log lines (#346)Daniel Watkins
Amazon Linux 2 is configured with a log format different to the one shipped by upstream, which means analyze fails to parse any of the log lines. This updates the code to know how to parse such lines. LP: #1876323
2020-05-04bsd: upgrade support (#305)Gonéri Le Bouder
Implement the upgrade support: - FreeBSD: using `pkg upgrade` - NetBSD: with `pkgin`
2020-05-04Add lucasmoura as contributor (#345)lucasmoura
2020-05-04Add "therealfalcon" as contributor (#344)James Falcon
2020-05-01Adapt the package building scripts to use Python 3 (#231)Paride Legovini
Since upstream cloud-init has dropped python2 support, adapt remaining package build scripts and tools to python3 only Changes: * Do not template debian/rules as python3 is the only supported version * Drop six from requirements.txt * Makefile: drop everything related to Python 2 * run-container: install the CI deps only on ubuntu|debian * read-version: update the shebang to use Python 3 * brpm: read_dependencies(): drop unused argument * read-dependencies: switch to Py3 and drop the --python-version option * pkg-deps.json: drop the Python version field and update the redhat deps * pkg-deps.json: drop the unittest2 and contextlib2 renames * Update RPM the spec file to use Python 3 when building the RPM * bddeb: drop support for Python 2
2020-05-01DataSourceEc2: use metadata's NIC ordering to determine route-metrics (#342)Daniel Watkins
We want to set route-metrics such that NICs are configured with the priority that they are given in the network metadata that we receive from the IMDS. (This switches away from using MAC ordering.) This also required the following test changes: * reverse the sort order of the MACs in test data (so that they would trigger the bug being fixed) * fix up the key names in `NIC2_MD` (which were under_scored instead of dash-separated) * use a full interface dict (rather than a minimal one) for `TestConvertEc2MetadataNetworkConfig` LP: #1876312
2020-04-30.travis.yml: introduce caching (#329)Daniel Watkins
cloud-images.ubuntu.com can sometimes be under heavy load; caching the images helps avoid that affecting our build times (or causing build failures entirely).
2020-04-30cc_locale: introduce schema (#335)Daniel Watkins
2020-04-30doc/rtd/conf.py: bump copyright year to 2020 (#341)Daniel Watkins
2020-04-30yum_add_repo: Add Centos to the supported distro list (#340)Ryan Harper
Users of Centos who want to add yum repos, like they do on Fedora or RHEL get this unfortunate message: Skipping modules 'yum-add-repo' because they are not verified on distro 'centos'. To run anyway, add them to 'unverified_modules' in config Centos certainly supports yum, add it to the supported distro list in the module.
2020-04-29Release 20.2 (#337)Chad Smith
Bump the version in cloudinit/version.py to 20.2 and update ChangeLog. LP: #1875951
2020-04-29doc/format: reference make-mime.py instead of an inline script (#334)Daniel Watkins
`make-mime.py` is a more recent version of the inline script that this link is replacing.
2020-04-28Add docs about creating parent folders (#330)Adrian Wilkins
Clarify in documentation that write_files will create parent folders for paths that do not already exist. This obfuscates what the problem is when people erroneously create files in /tmp despite the warnings in the documentation not to do so. People naturally assume that their file is absent because the parent folder did not exist for it to be created in, causing them to add a runcmd block to create the folder, even though execution order means that this will not occur until after write_files have all finished.
2020-04-28DataSourceNoCloud/OVF: drop claim to support FTP (#333)Daniel Watkins
I don't believe this has ever been supported, looking at the git history, but it certainly isn't at the moment. LP: #1875470
2020-04-27schema: ignore spurious pylint error (#332)Daniel Watkins
The line in question is in the code path handling older versions of jsonschema. In that context it _is_ correct, but when pylint analyses it against the latest jsonschema it (incorrectly) detects an error.
2020-04-24schema: add json schema for write_files module (#152)Chad Smith
Add schema definition to cc_write_files.py Cloud-config containing write_files config directives will now emit warnings for invalid config keys or values for the write_files module. Add an extension to JSON schema's draft4validator to permit either binary or text values for 'string' objects. This allows for JSON schema validating the YAML declaration of binary valiues in cloud-config using YAML's '!!binary' syntax. Add the ability to pass a specific module name to `cloud-init devel schema --docs <module_name>|all` to optionally limit doc output during development to a single schema doc.
2020-04-24BSD: find_devs_with_ refactoring (#298)Gonéri Le Bouder
Refactoring of the `find_devs_with_*bsd()` methods: - centralize everything in `util.py` - add test coverage
2020-04-24nocloud: drop work around for Linux 2.6 (#324)Gonéri Le Bouder
These two lines were a requirement for RHEL6, and they have been added 7 years ago: - https://github.com/canonical/cloud-init/commit/984c72e522c585c6d3f6b3d3aec39fb21dd84028 - https://github.com/canonical/cloud-init/commit/48a3b4ca0ba55699825d6eabe75d843286c23545 RHEL6 comes with Python 2.6, since Python3 is now a strong requirement, I think it's safe to remove.
2020-04-24cloudinit: drop dependencies on unittest2 and contextlib2 (#322)Daniel Watkins
These libraries provide backports of Python 3's stdlib components to Python 2. As we only support Python 3, we can simply use the stdlib now. This pull request does the following: * removes some unneeded compatibility code for the old spelling of `assertRaisesRegex` * replaces invocations of the Python 2-only `assertItemsEqual` with its new name, `assertCountEqual` * replaces all usage of `unittest2` with `unittest` * replaces all usage of `contextlib2` with `contextlib` * drops `unittest2` and `contextlib2` from requirements files and tox.ini It also rewrites some `test_azure` helpers to use bare asserts. We were seeing a strange error in xenial builds of this branch which appear to be stemming from the AssertionError that pytest produces being _different_ from the standard AssertionError. This means that the modified helpers weren't behaving correctly, because they weren't catching AssertionErrors as one would expect. (I believe this is related, in some way, to https://github.com/pytest-dev/pytest/issues/645, but the only version of pytest where we're affected is so far in the past that it's not worth pursuing it any further as we have a workaround.)
2020-04-23distros: handle a potential mirror filtering error case (#328)Daniel Watkins
As written, it's possible that the first transformation for a mirror hostname could be passed None if the parsed mirror URL didn't have a hostname component, when the defined interface is that the transformations will be passed strings. This isn't an error currently, because the first transformation happens to gracefully handle being passed None. It returns None, so the pipeline processing ends there. This was caught when testing out mypy on the cloud-init codebase.
2020-04-23log: remove unnecessary import fallback logic (#327)Daniel Watkins
logging.NullHandler has been present since Python 3.1, we don't need to handle its absence.
2020-04-23.travis.yml: don't run integration test on ubuntu/* branches (#321)Daniel Watkins
The integration test doesn't work against the ubuntu/* branches because it uses the tooling designed to work against master. This means that ubuntu/* branches always report failures in Travis, which doesn't give us any signal.
2020-04-23More unit test documentation (#314)Daniel Watkins
* HACKING.rst: add list of available pytest fixtures * HACKING.rst: capture common mock naming pattern in codebase
2020-04-23conftest: introduce disable_subp_usage autouse fixture (#304)Daniel Watkins
This mirrors the behaviour of CiTestCase.allowed_subp, by causing all calls to util.subp to raise an AssertionError.