summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* cli: add devel make-mime subcommand (#518)Ryan Harper2020-08-174-84/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * cli: add devel make-mime subcommand Cloud-init documents an in-source-tree tool, make-mime.py used to help users create multi-part mime user-data. This tool is not shipped in the cloud-init install and unavailable at runtime. This patch takes tools/make-mime.py and makes the functionality available via the devel subcommand. The primary interface of --attach file:content-type is still present. The cli now adds: -l, --list-types Print out a list of supported content-types -f, --force Ignore errors for unsupported content-types The tool will now raise a RunTime error if the supplied content-type is not supported (or more likely a typo: x-shell-script vs. x-shellscript) * make-mime: write to stderr and exit 1 instead of raising RuntimeError * Update example to match docs * Update docs for make-mime subcommand * Remove tools/make-mime.py; replaced by cloud-init devel make-mime Co-authored-by: Rick Harding <rharding@mitechie.com>
* user-data: only verify mime-types for TYPE_NEEDED and x-shellscript (#511)Ryan Harper2020-08-141-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit d00126c167fc06d913d99cfc184bf3402cb8cf53 regressed cloud-init handling in multipart MIME user-data. Specifically, cloud-init would examine the payload of the MIME part to determine what the content type and subsequently which handler to use. This meant that user-data which had shellscript payloads (starts with #!) were always handled as shellscripts, rather than their declared MIME type and affected when the payload was handled. One failing scenario was a MIME part with text/cloud-boothook type declared and a shellscript payload. This was run at shellscript processing time rather than boothook time resulting in an change in behavior from previous cloud-init releases. To continue to support known scenarios where clouds have specifed a MIME type of text/x-shellscript but provided a payload of something other than shellscripts, we're changing the lookup logic to check for the TYPES_NEEDED (text/plain, text/x-not-multipart) and only text/x-shellscript. It is safe to check text/x-shellscript parts as all shellscripts must include the #! marker and will be detected as text/x-shellscript types. If the content is missing the #! marker, it will not be excuted. If the content is detected as something cloud-init supports, such as #cloud-config the appropriate cloud-init handler will be used. This change will fix hanldling for parts which were shellscripts but ran with the wrong handler due to ignoring of the provided mime-type. LP: #1888822
* DataSourceOracle: retry twice (and document why we retry at all) (#536)Daniel Watkins2020-08-142-4/+9
|
* Refactor Azure report ready code (#468)Johnson Shi2020-08-133-162/+631
| | | This PR refactors Azure report ready code to include more robust tests and telemetry.
* tox.ini: pin correct version of httpretty in xenial{,-dev} envs (#531)Daniel Watkins2020-08-131-2/+5
| | | | | | | | | | The version was bumped in c7248059dd2faaaadfbcef5c83e8e8ea166d6767 to support running on Python 3.7+ systems. Now that we have separate `xenial` and `xenial-dev` tox environments, we can restore the correct pinning for `xenial` without breaking `xenial-dev` on developer machines. Also drop the `mock` dependency from `xenial-shared-deps`; its removal was missed in 5f8f85bb38cc972d3d2c705a1ec73db3f690f323.
* Support Oracle IMDSv2 API (#528)James Falcon2020-08-132-230/+330
| | | | * v2 of the API is now default with fallback to v1. * Refactored the Oracle datasource to fetch version, instance, and vnic metadata simultaneously.
* .travis.yml: run a doc build during CI (#534)Daniel Watkins2020-08-131-0/+2
| | | | We have doc8 configured, so we should use it to gate documentation changes.
* doc/rtd/topics/datasources/ovf.rst: fix doc8 errors (#533)Daniel Watkins2020-08-131-4/+10
| | | Plus a minor formatting improvement.
* Fix 'Users and Groups' configuration documentation (#530)sshedi2020-08-133-0/+13
| | | | | | | | Few of the 'User and Groups' configurations in cloud-config have no effect on already existing users. This was not documented earlier. This change set adds that information to documentation. Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
* cloudinit.distros: update docstrings of add_user and create_user (#527)Daniel Watkins2020-08-131-3/+19
| | | This aligns their docstrings more closely with their actual behaviour.
* Fix headers for device types in network v2 docs (#532)Caleb Xavier Berger2020-08-131-6/+4
|
* Add AlexBaranowski as contributor (#508)Aleksander Baranowski2020-08-101-0/+1
|
* DataSourceOracle: refactor to use only OPC v1 endpoint (#493)Daniel Watkins2020-08-104-533/+538
| | | | | | | | | The /opc/v1/ metadata endpoints[0] are universally available in Oracle Cloud Infrastructure and the OpenStack endpoints are considered deprecated, so we can refactor the data source to use the OPC endpoints exclusively. This simplifies the datasource code substantially, and enables use of OPC-specific attributes in future. [0] https://docs.cloud.oracle.com/en-us/iaas/Content/Compute/Tasks/gettingmetadata.htm
* .github/workflows/stale.yml: s/Josh/Rick/ (#526)Daniel Watkins2020-08-101-1/+1
| | | | We missed this one when we updated all the docs for the Canonical team's management change.
* Fix a typo in apt pipelining module (#525)Xiao Liang2020-08-102-1/+2
| | | | | | | | | | | | | * Fix a typo in apt pipelining module Changed `whcih` to `which`. * Update .github-cla-signers I have signed the CLA on Canonical's site, adding my username to list of CLA signers. * Update .github-cla-signers I need to sort the list alphabetically.
* test_util: parametrize devlist tests (#523)James Falcon2020-08-071-32/+24
|
* Recognize LABEL_FATBOOT labels (#513)James Falcon2020-08-076-85/+136
| | | | | | Update DataSourceNoCloud and ds-identify to recognize LABEL_FATBOOT labels from blkid. Also updated associated tests. LP: #1841466
* Handle additional identifier for SLES For HPC (#520)Robert Schweikert2020-08-061-1/+2
| | | Add "sle_hpc" to list of values which are variant 'suse'.
* Revert "test-requirements.txt: pin pytest to <6 (#512)" (#515)Daniel Watkins2020-08-011-2/+1
| | | | | pytest 6.0.1 fixes the issue we had with pytest 6.0.0. This reverts commit db5c1c81840638cfe6f08bbd40982b86dd3ecef7.
* test-requirements.txt: pin pytest to <6 (#512)Daniel Watkins2020-07-291-1/+2
| | | | pylint is emitting errors with pytest 6.x which are not observed on pytest 5.x. While that is resolved, pin to a lower pytest version.
* Add "tsanghan" as contributor (#504)tsanghan2020-07-241-0/+1
|
* fix brpm buildingRyan Harper2020-07-242-10/+31
| | | | | | | | | | tools/read-dependencies: - Add parameters --build-requires, --runtime-requires - Sort dependency output before printing package/brpm - use --build-requires, --runtime-requires to separate build/vs runtime package reqs. LP: #1886107
* Adding eandersson as a contributor (#502)Erik Olof Gunnar Andersson2020-07-231-0/+1
|
* azure: disable bouncing hostname when setting hostname fails (#494)Anh Vo2020-07-222-1/+19
| | | DataSourceAzure: Gracefully handle the case of set hostname failure during provisioning
* VMware: Support parsing DEFAULT-RUN-POST-CUST-SCRIPT (#441)xiaofengw-vmware2020-07-215-8/+143
| | | | | | | | | | | Add support for VMware's vCD configuration setting DEFAULT-RUN-POST-CUST-SCRIPT. When set True, it will default vms to run post customization scripts if the VM has not been configured in VMTools with "enable-custom-scripts" set False. Add datasource documentation with a bit more context about this interaction on VMware products. With this fix, the behavior will be: * If VM administrator doesn't want others to execute a script on this VM, VMtools can set "enable-custom-scripts" to false from the utility "vmware-toolbox-cmd". * If VM administrator doesn't set value to "enable-custom-scripts", then by default this script is disabled for security purpose. * For VMware's vCD product , the preference is to enable the script if "enable-custom-scripts" is not set. vCD will generate a configuration file with "DEFAULT-RUN-POST-CUST-SCRIPT" set to true. This flag works for both VMware customization engine and cloud-init.
* DataSourceAzure: Use ValueError when JSONDecodeError is not available (#490)Anh Vo2020-07-151-2/+7
| | | JSONDecodeError is only available in Python 3.5+. When it isn't available (i.e. on Python 3.4, which cloud-init still supports) use the more generic ValueError.
* cc_ca_certs.py: fix blank line problem when removing CAs and adding new one ↵dermotbradley2020-07-152-7/+35
| | | | | | | | | | | | | (#483) Problem: When cc_ca_certs configuration has both "remove-defaults: true" and also specifies one, or more, new trusted CAs to add then the resultant /etc/ca-certificates.conf file's 1st line is blank. As noted in comments in the existing cc_ca_certs.py code blank lines in this file cause problems. Fix: Before adding the cloud-init CA filename to this file first check the size of the file - if is is empty (as all existing CAs have been deleted) then write only the cloud-init CA filename to the file rather than appending it to the file.
* lp-to-git-users: adding anhvoms (#491)Anh Vo2020-07-151-0/+1
| | | Mapped from vtqanh
* freebsd: py37-serial is now py37-pyserial (#492)Gonéri Le Bouder2020-07-151-1/+1
| | | | | The package has been renamed. See: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246546
* ssh exit with non-zero status on disabled user (#472)Eduardo Otubo2020-07-152-2/+4
| | | | | | | | | | | | | | It is confusing for scripts, where a disabled user has been specified, that ssh exits with a zero status by default without indication anything failed. I think exitting with a non-zero status would make more clear in scripts and automated setups where things failed, thus making noticing the issue and debugging easier. Signed-off-by: Eduardo Otubo <otubo@redhat.com> Signed-off-by: Aleksandar Kostadinov <akostadi@redhat.com> LP: #1170059
* cloudinit: remove global disable of pylint W0107 and fix errors (#489)Daniel Watkins2020-07-1520-35/+1
| | | | | | | | * cloudinit: remove global disable of pylint W0107 and fix errors This includes removing a test class which contained no tests but wasn't detected as empty because of an errant pass statement. * .pylintrc: update disable comment to match arguments
* networking: refactor wait_for_physdevs from cloudinit.net (#466)Daniel Watkins2020-07-145-116/+229
| | | | | | | * Refactor `cloudinit.net.wait_for_physdevs` to `cloudinit.distros.networking.Networking.wait_for_physdevs` * Split the Linux-specific `udevadm_settle` call out to a separate abstract `Networking.settle` method; implement it on `LinuxNetworking` and add a `NotImplementedError` implementation to `BSDNetworking` * Modify `wait_for_physdevs`s one callsite to use the new location LP: #1884626
* HACKING.rst: add pytest.param pytest gotcha (#481)Daniel Watkins2020-07-131-0/+9
|
* cloudinit: remove global disable of pylint W0105 and fix errors (#480)Daniel Watkins2020-07-139-54/+45
| | | | This includes a fix to a test that had a string concatenation issue, and so was only testing a prefix of what was intended.
* Fix two minor warnings (#475)Daniel Watkins2020-07-132-3/+4
|
* test_data: fix faulty patch (#476)Daniel Watkins2020-07-101-1/+3
| | | | | | | I've been seeing intermittent failures of this test, and I tracked it down to something to do with`test_features.py`: running this test after `test_features.py` causes the failure, but the inverse does not. This fixed patch ensures that the test will pass regardless of ordering.
* cc_mounts: handle missing fstab (#484)Ryan Harper2020-07-102-10/+23
| | | | | | Do not fail if /etc/fstab is not present. Some images, like container rootfs may not include this file by default. LP: #1886531
* LXD cloud_tests: support more lxd image formats (#482)Paride Legovini2020-07-091-8/+25
| | | | | | | | Update lxd_export method to detect and handle different image formats cloud_tests will only support the "split" type images which exports a compressed (xz) tarball of metadata and a rootfs (of different formats). For non-split image formats (single tarball with metadata + rootfs) we now raise an exception indicating that the requested image is not supported at this time.
* Add update_etc_hosts as default module on *BSD (#479)Adam Dobrawy2020-07-072-6/+5
| | | | * Add update_etc_hosts as default module on *BSD * Set preference of IPv6 over IPv4 in FreeBSD /etc/hosts
* cloudinit: fix tip-pylint failures and bump pinned pylint version (#478)Daniel Watkins2020-07-063-4/+7
| | | | | | | | | | Specifically: * disable E1102 in cloudinit/sources/helpers/openstack.py for reasons described in a comment, and * refactor `abs_join` to require at least one positional argument; this matches os.path.join's signature, and that mismatch is what was causing pylint to emit a warning * bump to pylint 2.4.2
* Added BirknerAlex as contributor and sorted the file (#477)Alexander Birkner2020-07-031-2/+3
| | | | * Added myself as contributor to the project * Sorted the file alphabetically
* Update list of types of modules in cli.rstsaurabhvartak19822020-07-021-1/+1
| | | Added cloud_final_modules in place of cloud_init_modules under the heading 'modules'. cloud_init_modules was wrongly appearing twice.
* tests: use markers to configure disable_subp_usage (#473)Daniel Watkins2020-07-025-43/+76
| | | | | | | | | This is an improvement over indirect parameterisation for a few reasons: * The test code is much easier to read, the mark names are much more intuitive than the indirect parameterisation invocation, and there's less boilerplate to boot * The fixture no longer has to overload the single parameter that fixtures can take with multiple meanings
* Add mention of vendor-data to no-cloud format documentation (#470)Landon Kirk2020-07-022-0/+7
| | | Also add landon912 to .github-cla-signers
* Fix broken link to OpenStack metadata service docs (#467)Matt Riedemann2020-07-021-1/+1
|
* Disable ec2 mirror for non aws instances (#390)lucasmoura2020-06-307-89/+193
| | | | | For versions before 20.2, we allowed the use of ec2 mirrors if the datasource availability_zone matches one of the ec2 regions. We are now updating that behavior to allow allow the use of ec2 mirrors on ec2 instances or if the user directly passes an an ec2 mirror url through #cloud-config apt directives. LP: #1456277
* cloud_tests: don't pass --python-version to read-dependencies (#465)Daniel Watkins2020-06-301-1/+1
| | | We dropped that parameter in 4d26848
* networking: refactor is_physical from cloudinit.net (#457)Daniel Watkins2020-06-308-80/+181
| | | | | As the first refactor PR, this also includes the initial structure for tests. LP: #1884619
* Enable use of the caplog fixture in pytest tests, and add a cc_final_message ↵Daniel Watkins2020-06-305-8/+25
| | | | | test using it (#461) caplog is only available in pytest itself from 3.0 onwards. In xenial, we only have pytest 2.8.7. However, in xenial we do have pytest-catchlog available (as python3-pytest-catchlog), so we use that where appropriate.
* RbxCloud: Add support for FreeBSD (#464)Adam Dobrawy2020-06-292-8/+22
| | | | | | | Changes are made that simplify code and aim to properly support FreeBSD: - use `util.find_devs_with` instead call directly `blkid`, because on FreeBSD is not supported well and `util.find_devs_with` have solution for FreeBSD for that - introduction of an additional name on FAT file system, which is used in FreeBSD - drop shell to use default value, because FreeBSD – by default – does not have `/bin/bash`