summaryrefslogtreecommitdiff
path: root/cloudinit/sources/DataSourceDigitalOcean.py
AgeCommit message (Collapse)Author
2020-06-30networking: refactor is_physical from cloudinit.net (#457)Daniel Watkins
As the first refactor PR, this also includes the initial structure for tests. LP: #1884619
2017-12-05Datasources: Formalize DataSource get_data and related properties.Chad Smith
Each DataSource subclass must define its own get_data method. This branch formalizes our DataSource class to require that subclasses define an explicit dsname for sourcing cloud-config datasource configuration. Subclasses must also override the _get_data method or a NotImplementedError is raised. The branch also writes /run/cloud-init/instance-data.json. This file contains all meta-data, user-data and vendor-data and a standardized set of metadata keys in a json blob which other utilities with root-access could make use of. Because some meta-data or user-data is potentially sensitive the file is only readable by root. Generally most metadata content types should be json serializable. If specific keys or values are not serializable, those specific values will be base64encoded and the key path will be listed under the top-level key 'base64-encoded-keys' in instance-data.json. If json writing fails due to other TypeErrors or UnicodeDecodeErrors, a warning log will be emitted to /var/log/cloud-init.log and no instance-data.json will be created.
2017-04-21pylint: fix all logging warningsJoshua Powers
This will change all instances of LOG.warn to LOG.warning as warn is now a deprecated method. It will also make sure any logging uses lazy logging by passing string format arguments as function parameters.
2016-12-22LICENSE: Allow dual licensing GPL-3 or Apache 2.0Jon Grimm
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.
2016-09-29DigitalOcean: use meta-data for network configruationBen Howard
On DigitalOcean, Network information is provided via Meta-data. It changes the datasource to be a local datasource, meaning it will run before fallback networking is configured. The advantage of that is that before networking is configured it can bring up a network device with ipv4 link-local and hit the metadata service that lives at 169.254.169.254 to find its networking configuration. It then takes down the link local address and lets cloud-init configure networking. The configuring of a network device to go looking for a metadata service is gated by a check of data in the smbios. This guarantees that the code will not run on another system.
2016-08-12DigitalOcean: use the v1.json endpointBen Howard
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/
2016-05-12Fix up a ton of flake8 issuesJoshua Harlow
2016-03-04Apply pep8, pyflakes fixes for python2 and 3Scott Moser
Update make check target to run pep8 and run pyflakes or pyflakes3 depending on the value of 'PYVER'. This way the python3 build environment does not need python2 and vice versa. Also have make check run the 'yaml' test. tox: have tox run pep8 in the pyflakes
2015-02-25move towards user-data being binaryScott Moser
UrlResponse: biggest change... make readurl return bytes, making user know what to do with it. util: add load_tfile_or_url for loading text file or url as read_file_or_url now returns bytes ec2_utils: all meta-data is text, remove non-obvious string translations DigitalOcean: adjust for ec2_utils DataSourceGCE, DataSourceMAAS: user-data is binary other fields are text. openstack.py: read paths without decoding to text. This is ok as paths other than user-data are json, and load_json will handle load_file still returns text, and that is what most things use.
2015-02-23Make parameter list for get_hostname method consistentJoshua Harlow
2015-01-22Make parameter list for get_hostname method consistentMarco Morais
The sources.DataSource class has method defined as: def get_hostname(self, fqdn=False, resolve_ip=False) Make the parameter list for this method in DataSourceDigitalOcean and DataSourceGCE consistent with superclass sources.DataSource.
2015-01-21Largely merge lp:~harlowja/cloud-init/py2-3 albeit manually because it seemedBarry Warsaw
to be behind trunk. `tox -e py27` passes full test suite. Now to work on replacing mocker.
2015-01-06tools/run-pep8: remove leading ',' fed to --ignoreScott Moser
--ignore was being called with ',E121,E...' rather than 'E121,E...'. that resulted in odd behavior, missing the pep8 errors that are fixed here.
2014-10-20Add Digital Ocean Datasource.Scott Moser
This adds a DataSource for DigitalOcean's metadata service. The service is documented at https://developers.digitalocean.com/metadata/ .
2014-10-17Explicitly import only types being comparedNeal Shrader
2014-10-17Correct handling of single/multiple ssh keysNeal Shrader
2014-10-16Use existing metadata crawler to populate datasourceNeal Shrader
2014-10-16Make metadata timeout/retries configurableNeal Shrader
Defaulting to only trying once.
2014-10-16Add DigitalOcean DataSourceNeal Shrader
The DigitalOcean metadata service is an AWS-style service available over HTTP via the link local address 169.254.169.254. The specifics of the API are documented at: https://developers.digitalocean.com/metadata/