Age | Commit message (Collapse) | Author |
|
Add instructions on how to run the cii tests to the docs.
|
|
When testing for timezone we were testing that 'date' output would
contain 'HDT' for the current time. But after a 'spring forward', the
current time started to have 'HST'.
Instead of asking 'date' for the timezone that applies now, ask it
for a static date.
|
|
Omnibus installation of chef was broken under python3.
LP: #1583837
|
|
This exposes a mechanism for users of cloud-init to determine if
a version has a specific feature, and adds documentation to that affect.
We list an existing feature NETWORK_CONFIG_V1 as an example.
Also add a 'features' subcommand for listing these to stdout.
|
|
Because the tests/cloud_tests require specific version of pylxd
adding a tox environment makes that much easier.
Additionally it makes calling it at least a bit simpler.
Example:
tox -e citest -- run -v -n zesty --deb=cloud-init_all.deb
|
|
The adjusted change did not support
#cloud-config
password: passw0rd
This correctly fixes that regression.
|
|
This regression was caused by my rework of Sergio's branch.
The change now still works when there is no chpasswd/list provided.
|
|
cc_set_passwords previously supported 'list' as a multiline string:
chpasswd:
list: |
user:pass1
user015:R
This patch adds support for user/pairs as a list:
chpasswd:
list:
- user:pass1
- user015:R
LP: #1665694
|
|
The documentation indicated chpasswd/list should be a list when
the code only accepts a string.
LP: #1665773
|
|
Previously, cloud-init would throw an exception if an interface had
both ipv4 and ipv6 addresses and a default gateway for each address
family. This change allows cloud-init to correctly configure
interfaces in this situation.
LP: #1669504
|
|
log a warning rather than raising ValueError if we see more than three
nameserver addresses.
LP: #1670052
|
|
Change policy so that 'report' can be overridden.
In xenial we had set the builtin default to be 'report', expecting
that Ubuntu core would install config that changed it to 'search'.
However, if report was already set, there was no way to unset it.
The change here is to make 'report' basically 'search-dryrun', so
that one or the other can be set.
The other change here is that report would actually exit disabled
if it did not find a datasource and notfound=disabled. That was
unexpected and would turn cloud-init off, which is not what we wanted.
Additionally, consistently use 'enabled' or 'disabled' versus
'enable' and 'disable'.
LP: #1669949
|
|
Rather than having the dscheck_Ec2 just know the setting, move
it up to a more formal declaration. This will make it look more
clean when a distro carries a patch to change it to warn.
|
|
On a 'not found' result, was not being written at all.
That had the unintended effect of '--force' not working.
Now, on a 'not found' result:
- if reporting: write the list as found (with just 'None').
- if not reporting: only report that there was nothing found.
this means that the warning cloud-init will write about ds-identify
failing to find a datasource will be written, but cloud-init will
still search its fully configured list.
|
|
If ds-identify is in report mode, and the datasource that is found
is not in the list, then warn the user of this situation.
|
|
Now, when ds-identify runs in report mode, it still writes to
/run/cloud-init.cfg as search does, but it will namespace the
result under the top level 'di_report' entry.
|
|
This moves the warning code that was added specifically for
EC2 into a generic path at cloudinit/warnings.py.
It also adds support for writing warning files into the
warnings directory to be shown by Z99-cloudinit-warnings.sh.
|
|
Z99-cloudinit-warnings.sh can be dropped into /etc/profile.d.
Warnings that are written to /var/lib/cloud/instance/warnings
will be displayed to the user on stderr when they log in.
|
|
Modify upstream packaging to install this file, which was
already installed in ubuntu packaging.
Also, white space changes from tabs to spaces. Very few things
in cloud-init are tabs now.
Lastly, remove the executable bit on this as ait is not necessary.
Scripts in /etc/profile.d do not have executable bit.
|
|
In the interest of speed I had skipped the parsing of
/etc/cloud/cloud.cfg for the ec2 strict_id setting. In hindsight
it seems reasonable for people to put settings there.
|
|
ovf_vmware_guest_customization defaults to true in cloud-init, meaning
that such customization is disabled. We just missed a return value
causing ovf_vmware_guest_customization to effectively default to on.
Also, when looking for setting look at /etc/cloud/cloud.cfg.
This had been omitted in interest of performance, but we should
be looking there.
|
|
cloud-init by default sets 'disable_vmware_customization' to True.
So in ds-identify, we will enable the ovf datasource if:
- virt is vmware
- 'libdeployPkgPlugin.so' exists as installed by vmware-tools or
open-vm-tools.
- disable_vmware_customization is configured to True
|
|
Brightbox will identify their platform to the guest by setting the
product serial to a string that ends with 'brightbox.com'.
LP: #1661693
|
|
Based on the setting Datasource/Ec2/strict_id, the datasource
will now warn once per instance.
|
|
ds-identify will now read this setting, and thus allow the user
to modify ds-identifies behavior via either:
1. builtin setting here cloud-init/ds-identify builtin
2. ds-identify config (/etc/cloud/ds-identify.cfg)
3. system config (/etc/cloud/cloud.cfg.d/*Ec2*.cfg)
4. kernel command line (ci.datasource.ec2.strict_id=true)
|
|
A check function that returns found or maybe can also now
return config that will be written to the resultant /run/cloud.cfg.
They do so by setting the variable _RET_excfg.
|
|
This just adds checking of the Ec2 seed directory.
|
|
The following can have cause issue:
FOO="bar ; wark"
showit() {
local b=$FOO
echo $b
}
4: local: ;: bad variable name
The answer is just to use more quotes.
|
|
Just remove some examples that are no longer valid.
|
|
This makes ds-identify run only once. Previously it would run multiple
times each boot as the generator would run more than once. This is
potentially dangerous, in that running again might find more attached
disks. However that is really only a "lucky" fix if it happens to
result differently than the first run.
Additionally, we now log the uptime that we started and ended at.
|
|
|
|
There were some logic errors in sysconfig.py that appear to be the
result of accidentally typing "iface" where it should have been
"iface_cfg". This patch corrects those problems so that the module
can run successfully.
LP: #1665441
Resolves: rhbz#1389530
|
|
the MetadataLeafDecoder would return a bytes value b'' instead of
an empty string if the value of a key was empty. In all other cases
the value would be a string.
This was discovered when trying to json.dumps(get_instance_metadata())
on a recent OpenStack, where the value of 'public-ipv4' was empty.
The attempt to dump that with json would raise
TypeError: b'' is not JSON serializable
|
|
When the ds-identify code landed, it started writing /run/cloud.cfg
but at the moment, nothing was reading that. The result is that
ds-identify only worked to disable cloud-init entirely.
|
|
has_fs_with_label regressed when refactoring to not have leading
and trailing , in DI_FS_LABELS.
LP: #1663735
|
|
The nocloud datasource specifically would look for ds=nocloud or
ds=nocloud-net (often augmented with 'seedfrom') on the kernel command line.
Fix to return DS_FOUND in that case.
LP: #1663723
|
|
Nova lxd will now put the environment variable 'platform' into
pid 1's environment to the value 'OpenStack Nova', which is the same as
you would find in kvm guests.
LP: #1661797
|
|
aarch64 does support dmi, but OpenStack does not populate guests
with this information, and there are currently bugs in qemu preventing
it from working correctly see bug #1663304 for more information.
So, for the time being, pretend as if there is no dmi data on aarch64,
which will make it enable cloud-init even when no datasources are found.
|
|
- make check will no longer run the style checks, that way package builds
wont fail on a style difference in versions of the style tools in
that distro.
- created style-check make file target to continue to run pep8 and pyflakes
- added tox envs 'tip-pycodestyle' and 'tip-pyflakes' to run latest style
checking. These are not enabled by default run of tox.
LP: #1652329
|
|
$ pycodestyle cloudinit/ tests/ tools/
tools/make-mime.py:25:5: E722 do not use bare except'
tools/mock-meta.py:252:17: E722 do not use bare except'
For tools/make-mime.py:25:5: E722 do not use bare except' the use case is
when someone runs
./make-mime.py --attach commis
instead of
./make-mime.py --attach commissaire.txt:x-commissaire-host
The split can cause a ValueError potentially if there is no:
For tools/mock-meta.py:262:17: E722 do not use bare except' the use case is
a dictionary look up occurs potentially when an unknown key is given:
key_name = key_ids[key_id]
Do note that version 2.3.0 falsely reported a dozen or so E302 and E306
errors.
|
|
When manual_cache_clean is enabled, write a file to
/var/lib/cloud/instance/manual-clean. That file can then be read by
ds-identify or another tool to indicate that manual cleaning is in place.
|
|
ds-identify is run here from the generator. If ds-identify does
not see any datasources, it can completely disable cloud-init.
The big value in this is that if there is no datasource, no python
will ever be loaded, and cloud-init will be disabled.o
The default policy being added here is:
search,found=all,maybe=all,notfound=disabled
That means:
- enable (in 'datasource_list') all sources that are found.
- if none are found, enable all 'maybe'.
- if no maybe are found, then disable cloud-init.
On platforms without DMI (everything except for aarch64 and x86),
the default 'notfound' setting is 'enabled'. This is because many of
the detection mechanisms rely on dmi data, which is present only on
x86 and aarch64.
|
|
* Fix small typo
* Fix ISO-Filename for consistency
|
|
The iface:alias syntax for eni rendering is brittle with ipv6.
Replace it with using multiple iface stanzas with the same iface
name which is supported. Side-effect is that one can no longer
do 'ifup $iface:$alias' but requires instead use of ip address
{add|delete} instead.
LP: #1657940
|
|
Fix mock-meta to work with python2 or python3.
Additionally, it will now listen to ipv6 connections, where
previously it would only work with ipv4.
|
|
The test_user_data_normalize and test_net files had gotten
the executable bit set, and thus are skipped by nose by default.
We could set run with the --exe flag, but they should not have
gotten this way.
Other changes here:
* replace TempDirTestCase with CiTestCase, which has some nice
tmp_dir() and tmp_path() functions. Going forward the intent
is to have CiTestCase be the base test case for tests.
* test_net: switch to CiTestCase and fix usage that was
silently broken, because of exe bit.
* populate_dir: return the list of files that it writes rather
than having no return value.
* CiTestCase:
* support tmp_path("foo") that returns a full path to 'foo'
under a tmpdir.
* add tmp_dir() to get a temp dir and clean up.
|
|
No shipping ubuntu has a python 3.4 that is less than 3.4.2.
Remove this workaround to avoid unnecessary complexity.
This reverts 04a60cf949.
|
|
cloud-init adds ssh_authorized_keys to the default user and to
root but for root it disables the keys with a prefix command.
However, if the public_key key is of type ecdsa-sha2-nistp521,
it is not parsed correctly, and the prefix command is not prepended.
Resolves: rhbz#1151824
LP: #1658174
|
|
this ensures that we call httpretty.reset() before calling
httppretty.register_uri(...), which ensures that we get a fresh
callback with the expected version of the metadata.
LP: #1658200
|
|
running 'make' on a git branch other than master would fail with
complaint that the tools/read-version reported a different version
than the code.
Change to only consider tags starting with 0-9 in read-version.
|