Age | Commit message (Collapse) | Author |
|
|
|
For now, this vendor data handling is just added to openstack.
However, in an effort to allow sanely handling of multi-part vendor-data
that is namespaced, we add openstack.convert_vendordata_json .
That basically takes whatever was loaded from vendordata and takes
the 'cloud-init' key if it is a dict. This way the author can
namespace cloud-init, basically telling it to ignore everything else.
|
|
instead of taking a version that they should look for,
the readers now just select the highest supported version.
definitely a use case later for having version= but nothing
is using it now.
|
|
|
|
This data will be treated the same as vendordata from other sources.
|
|
Updated read_config_drive: removed the unused version kwarg, used the
OS_VERSIONS tuple from the openstack helper to avoid hardcoding
versions.
Added a comment to the tuple in helpers/openstack.py asking for it to
be kept in chronological order.
|
|
vendor_data is guaranteed to be a dict if it exists; if it doesn't
exist ensure it's represented by an empty dict to avoid checking
it to see if it's a dict.
|
|
- Also utilizing the constants defined in
cloudinit/sources/helpers/openstack.py for configdrive versions
|
|
- Upgrade configdrive to use 2013-10-17
- Fix issue with vendor_data.json parsing
Co-Authored-By: Paul Querna <pquerna@apache.org>
|
|
|
|
|
|
When cloud-init writes previous-instance-id, it does so with a
trailing '\n'. This isn't ideal, as other readers also have to know
that this will have a trailing '\n' on it, but here we just trim that off.
|
|
The instance-id file contains the instance id
and a newline, to compare correctly make sure
we strip the newline before further usage.
|
|
|
|
|
|
Openstack has a unique derivative datasource
that is gaining usage. Previously the config
drive datasource provided part of this functionality
as well as the ec2 datasource, but since new
functionality is being added to openstack is
seems benefical to combine the used parts into
one datasource just made for handling openstack
deployments.
This patch factors out the common logic shared
between the config drive and the openstack
metadata datasource and places that in a shared
helper file and then creates a new openstack
datasource that readers from the openstack metadata
service and refactors the config drive datasource
to use this common logic.
|
|
|
|
|
|
LP: #1198297
|
|
A new field in the metadata has emerged, one
that provides a way to seed the linux random
generator. Add support for writing the seed
and rewrite parts of the on_boot code to use
a little helper class.
LP: #1198297
|
|
Extend a prior fix which helped discovery of media on systems using 2.6
kernels. /dev/sr0 covers only some of the use cases, /dev/sr1 is also
common.
|
|
This patch fixes issues in Fedora 18 (and upcoming RHEL 7) which are
present due to their use of systemd:
- store locale configuration in /etc/locale.conf
- store hostname in /etc/hostname
- use a symlink for /etc/localtime (prior code would set the timezone
but corrupt data in /usr/share/zoneinfo due to presence of symlink)
It also contains fixes for issues unrelated to systemd adoption:
- explicitly scan /dev/sr0 with blkid in order to get the optical drive
in the blkid cache. This prevents an issue on systems running 2.6
kernels (such as RHEL 6) in which config disks on some devices won't
be detected unless the device has previously been queried.
(For reference, see https://patchwork.kernel.org/patch/1770241/)
- append a newline when rewriting sysconfig files, as this is customary
text configuration file formatting and is expected by some parsers
(such as the ifcfg-rh plugin for NetworkManager)
|
|
|
|
|
|
|
|
previously, there was an attempt in the config drive source to limit
the source device to a "full block device" rather than a partition.
This was done by a simplistic approach of checking that the last
character of the name was not a number. That was filtering out
CD-rom devices (sr0).
Now, we have a bit more sophisticated approach to that same problem.
We filter out block devices that have a 'partition' entry in
/sys/class/block/DEVICE_NAME/partition .
LP: #1100545
|
|
This does a couple things:
* separates out the 'normalize_public_keys' from the DataSource's get_public_ssh_keys
* uses that from config-drive datasource
* supports config drive v1 or v2 public-keys
* adds a test.
LP: #1077700
|
|
'public_keys'
|
|
other datasources populate 'public-keys' rather than 'public_keys'
and there is a more complete handler in the base DataSource.
So, to take advantage of that, have DataSourceConfigDrive copy
public_keys to public-keys, and remove the 'get_public_ssh_keys'
from the DataSourcEConfigDrive.
LP: #1077700
|
|
Use only util methods for reading/loading/appending/peeking
at files since it is likely soon that we will add a new
way of adjusting the root of files read, also it is useful
for debugging to track what is being read/written in a central
fashion.
|
|
to ensure that even if they are found that they
are also valid, before they are assumed to be
the correct device name.
|
|
Also fix the extraction of the metadata key name
since it actually uses 'dashes' instead of being
a single word.
|
|
translate the device name to a actual device using
logic that will try the ec2 metadata (if avail) or
will try using 'blkid' to find a corresponding label.
LP: #1062540
|
|
we map 'hostname' to 'local-hostname'
so that the modules work correctly with
the cfgdrive style of data.
|
|
at files since it is likely soon that we will add a new
way of adjusting the root of files read, also it is useful
for debugging to track what is being read/written in a central
fashion.
|
|
If 'latest' is found, but '2012-08-10' is not, we will log a warning
but attempt to use it.
|
|
at the point where we are getting the previous instance id, there
cloud-init hasn't performed the move yet. Therefore, the "previous"
is the one that /var/lib/cloud/data/ says is the current.
|
|
openstack metadata uses 'uuid' as an instances 'instance-id'.
just copy that to the metadata['instance-id']
|
|
|
|
|
|
|
|
|
|
make pep8 now is silent on precise's pep8 ( 0.6.1-2ubuntu2).
|
|
2. Adjust comment on sources list from depends
3. For the /etc/timezone 'writing', add a header that says created by cloud-init
|
|
|
|
|
|
|
|
use logexc instead of log.exception
|
|
|
|
|