Age | Commit message (Collapse) | Author |
|
load_shell_content previously would not allow shell comment characters
in the content being parsed. If comments=True is not passed then an
exception would previously be raised as the line would not be guaranteed to
have an '=' in it.
|
|
This fixes stacktrace and warning message that would be printed
to the log if running inside a container and read_dmi_data tried
to access a key that was not present.
In a container, the /sys/class/dmi/id data is not relevant to the
but to the host. Additionally an unpriviledged container might see
strange behavior:
# cd /sys/class/dmi/id/
# id -u
0
# ls -l chassis_serial
-r-------- 1 nobody nogroup 4096 Jun 29 16:49 chassis_serial
# cat chassis_serial
cat: /sys/class/dmi/id/chassis_serial: Permission denied
The solution here is to just always return None when running in a
container.
LP: #1701325
|
|
- Simplify the logic of 'variant' in util.system_info
much of the data from
https://github.com/hpcugent/easybuild/wiki/OS_flavor_name_version
- fix get_resource_disk_on_freebsd when running on a system without
an Azure resource disk.
- fix tools/build-on-freebsd to replace oauth with oauthlib and add
bash which is a dependency for tests.
- update a fiew places that were checking for freebsd but not using
the util.is_FreeBSD()
|
|
This just moves flake8 and related tools up to newer versions and fixes
the complaints associated with that.
We added to the list of flake8 ignores:
H102: do not put vim info in source files
H304: no relative imports
Also updates and pins the following in the flake8 environment:
pep8: 1.7.0 => drop (although hacking still pulls it in).
pyflakes 1.1.0 => 1.5.0
hacking 0.10.2 => 0.13.0
flake8 2.5.4 => 3.3.0
pycodestyle none => 2.3.1
|
|
Recent core snap images (edge channel revision 1886) do not contain the
previously known files used to detect that a system is ubuntu core.
The changes here are to look in 2 additional locations to determine
if a system is snappy.
LP: #1689944
|
|
This patch targets to make FreeBSD 10.3 or 11 work on Azure. The
modifications abide by the rule of:
* making as less modification as possible
* delegate to the distro or datasource where possible.
The main modifications are:
1. network configuration improvements, and movement into distro path.
2. Fix setting of password.
Password setting through "pw" can only work through pipe.
3. Add 'root:wheel' to syslog_fix_perms field.
4. Support resizing default file system (ufs)
5. copy cloud.cfg for freebsd to /etc/cloud/cloud.cfg rather than
/usr/local/etc/cloud/cloud.cfg.
6. Azure specific changes:
a. When reading the azure endpoint, search in a different path
and read a different option name (option-245 vs. unknown-245).
so, the lease file path should be generated according to platform.
b. adjust the handling of ephemeral mounts for ufs filesystem and
for finding the ephemeral device.
c. fix mounting of cdrom
LP: #1636345
|
|
On centos/fedora/rhel/derivatives, /etc/ssh/sshd_config has mode 0600,
but cloud-init unilaterally sets file modes to 0644 when no explicit
mode is passed to util.write_file. On ubuntu/debian, this file has
mode 0644. With this patch, write_file learns about the copy_mode
option, which will cause it to use the mode of the existing file by
default, falling back to the explicit mode parameter if the file does
not exist.
LP: #1644064
Resolves: rhbz#1295984
|
|
This has been a recurring ask and we had initially just made the change to
the cloud-init 2.0 codebase. As the current thinking is we'll just
continue to enhance the current codebase, its desirable to relicense to
match what we'd intended as part of the 2.0 plan here.
- put a brief description of license in LICENSE file
- put full license versions in LICENSE-GPLv3 and LICENSE-Apache2.0
- simplify the per-file header to reference LICENSE
- tox: ignore H102 (Apache License Header check)
Add license header to files that ship.
Reformat headers, make sure everything has vi: at end of file.
Non-shipping files do not need the copyright header,
but at the moment tests/ have it.
|
|
These are just simple syntax fixes to work correctly on python2.6.
Found when testing in a centos 6 container.
|
|
This replaces long single lines in a log or console output
with multiple lines that are much easier to read.
It indents the stdout and stderr so logs are more easily
read also.
|
|
aarch64 systems have functional dmidecode, so allow that to be used.
- aarch64 has support for dmidecode as well
|
|
This gets the tests running in centos 6.
* ProcessExecutionError: remove setting of .message
Nothing in cloud-init seems to use .message anywhere, so
it does not seem necessary.
The reason to change it is that on 2.6 it spits out:
cloudinit/util.py:286: DeprecationWarning: BaseException.message
* tox.ini: add a centos6 environment
the tox versions listed here replicate a centos6 install with
packages from EPEL.
You will still need a python2.6 to run this env so we do not
enable it by default.
|
|
The test in decode_binary for six.text_type was incorrect as that includes
unicode type in Python 2 which should actually be decoded.
When the type is string_types we now properly check only for basestring and
str in Python 2 and Python 3 respectively and return the given blob without
making an attempt to decode.
|
|
In order for a caller to use 'env' argument of subp, they
will realistically do:
env = os.environ.copy()
env['FOO'] = 'BZR'
subp(cmd, env=env)
This shortens that to be:
subp(cmd, update_env={'FOO': 'BZR'})
Add tests, and update growpart tests to use mock when playing with
os.environ.
|
|
This adds an improved apt configuration format that is fully backwards
compatible with previous behavior. This is mostly copied from curtin's
implementation.
It does:
* clean up and centralizes many of the top level 'apt_*' values that
previously existed into a single top level 'apt'key.
* support a 'source' in apt/sources/entry that has only a key
* documents new features and adds tests.
See the added doc/examples/cloud-config-apt.txt for more information.
|
|
Per [1], DigitalOcean provides the metadata in multiple formats. The JSON
document is the preferred endpoint.
Changes:
- Switch to the v1.json meta-data endpoint
- Identify droplet identity from SMBIOS
- Only poll for metadata when the instance is confirmed to be a droplet
- Removal of hard-coded mirrors
Additionally, centralize the gates on running 'dmidecode' on arm arches,
and update tests to address.
[1] https://developers.digitalocean.com/documentation/metadata/
|
|
Previously we returned a string of "." the same length as the dmi field.
That seems confusing to the user as "." would seem like a valid response
when in fact this value should not be considered valid.
So now, in this case, return empty string.
|
|
Previously we returned a string of "." the same length as the dmi field.
That seems confusing to the user as "." would seem like a valid response
when in fact this value should not be considered valid.
So now, in this case, return empty string.
|
|
it is not uncommon to find dmi data in /sys full of 'ff'. utf-8
decoding of those would fail, causing warning and stacktrace.
Return '.' instead of \xff. This is what dmidecode would return.
$ dmidecode --string system-product-name
|
|
it is not uncommon to find dmi data in /sys full of 'ff'. utf-8
decoding of those would fail, causing warning and stacktrace.
Return '.' instead of \xff. This maps to what dmidecode would return
$ dmidecode --string system-product-name
.................................
|
|
read_seeded was assuming a Response object back from load_tfile_or_url
but load_tfile_or_url was returning string.
since the only other user of this was a test, move load_tfile_or_url to
a test, and just do the right thing in read_seeded.
LP: #1455233
|
|
This is to work-around the fact that email.message_from_string uses
cStringIO in Python 2.6, which can't handle Unicode.
|
|
dmidecode and /sys/class/dmi/id/* use different names for the same
information. This modified the logic in util.read_dmi_data to map from
dmidecode names to sysfs names before looking in sysfs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This just removes comments '# pylint:' things and other code
remnents of pylint.
|
|
previous commit occurred because the selinux test was failing
in a schroot where there was no /etc/hosts.
Now, fix that test more correctly, and fix some bad assumptions in
the SeLinuxGuard.
|
|
Also, in debian packaging depend on it (so it wont skip there).
|
|
|
|
|
|
|
|
Move long lines out of the test_util.py file and into tests/data.
no pep8 or pylint errors now.
|
|
a.) appease pylint on raring, as it doesn't like subprocess
pylint: 0.26.0-1ubuntu1
This is mentioned in comments at http://www.logilab.org/ticket/46273
b.) tests/unittests/test_util.py:
the mountinfo lines are longer than 80 chars.
Just disable long lines complaints for this file.
|
|
|
|
of the init class are reset so that when they are
regenerated that they will use the updated data
instead of using previous data (since they weren't reset).
LP: #1076811
|
|
In 0.7.0 we started using yaml.safe_load to load data rather than
yaml.load. Some producers (namely, ubuntu MAAS created) have produced
cloud-config data in the past that included python unicode types.
This creates a specialized safe_loader that is basically safe_load +
support for python unicode.
|
|
make pep8 now is silent on precise's pep8 ( 0.6.1-2ubuntu2).
|
|
The methods here have to match the real Selinux signiture, so
even though we dont use these variables.
|