summaryrefslogtreecommitdiff
path: root/tests/unittests/test_datasource/test_openstack.py
AgeCommit message (Collapse)Author
2017-05-23flake8: move the pinned version of flake8 up to 3.3.0Scott Moser
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
2017-01-24tests: No longer monkey patch httpretty for python 3.4.2Scott Moser
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.
2017-01-17OpenStack: Use timeout and retries from config in get_data.Lars Kellogg-Stedman
This modifies get_data in DataSourceOpenStack.py to get the timeout and retries values from the data source configuration, rather than from keyword arguments. This permits get_data to use the same timeout as other methods, and allows an operator to increase the timeout in environments where the metadata service takes longer than five seconds to respond. LP: #1657130 Resolves: rhbz#1408589
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-11-07pyflakes: fix issue with pyflakes 1.3 found in ubuntu zesty-proposed.Scott Moser
An obvious fix for an issue raised by pyflakes 1.3.
2016-08-12MAAS: add vendor-data supportScott Moser
Add vendor-data support to maas which will behave like the openstack vendor-data does. Data returned from maas must be yaml loadable. Also update the main in DataSourceMAAS to "just work" on a maas deployed system. LP: #1612313
2016-05-16Fix slow testsJoshua Harlow
Timeouts and retries were triggering so make it so that tests do not use the typical timesouts and retries so that the tests finish faster.
2016-05-12run flake8 instead of pyflakes in tox. expect tests/ to pass flake8.Scott Moser
2015-03-04Fix hang caused by HTTPretty on Python 3.4.2.Daniel Watkins
HTTPretty can causes hangs on Python 3.4.2 (and maybe Python 3.4.1), due to a Python bug (fixed in Python 3.4.3). This works around the problem in the appropriate Python versions. See https://github.com/gabrielfalcao/HTTPretty/pull/193 and https://github.com/gabrielfalcao/HTTPretty/issues/221 for details.
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-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.
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-10Fix some of the erroring out test casesJoshua Harlow
There are a couple new test cases that are now erroring out. - A usage of the non helper unit testcase base which is trigging and error on python 2.6 due to lack of method, fix this by using the base helper class. - A freebsd distro test check thats looking for /etc/resolv.conf and examining its contents, which won't exist due to our mocking routine that does not allow that file to be read. - A freebsd distro test where the distro class tries to call into ['ifconfig', '-a'] for a set of values, those values don't exist on the machine I am running on (and likely others machines) so we should mock the subp function out (that the distro class calls) and correctly return values that will work for the testcase.
2014-09-10Openstack: Vendor data cleanupScott Moser
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.
2014-09-10drop version= from readersScott Moser
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.
2014-08-27no functional changes, but some minor changes.Scott Moser
2014-08-27Fixed more of the slowness around fetching and retryingJoshua Harlow
2014-08-22ec2_utils.py: get_instance_metadata explicitly add trailing /Scott Moser
This change works around a bug in CloudStack's EC2 api implementation. That is filed upstream at [1]. The fix is safe for openstack and EC2 use cases as well. EC2 and OpenStacks' EC2 metadata service both return a list with access to either of: <url_base>/latest/meta-data <url_base>/latest/meta-data/ Additionally, the responses explicitly contain a trailing '/' for items that have a child. The ec2_utils code then just re-uses the trailng / there. Thus, only the top level request for 'meta-data/' needs the explicit fix. This also changes test cases. Those test cases failed without fixing them. If ever this regressed, those would fail again. -- [1] https://issues.apache.org/jira/browse/CLOUDSTACK-7405 LP: #1356855
2014-07-24merge from trunkScott Moser
2014-07-23fix httpretty based test cases if http_proxy is set.Scott Moser
previously this would fail: http_proxy=http://foo.bar make test now it will pass. This works around a bug where httpretty is not able to patch http operations if http_proxy is set. https://github.com/gabrielfalcao/HTTPretty/issues/122
2014-07-23moreDimitri John Ledkov
2014-02-08Remove HEAD usage and other small adjustmentsJoshua Harlow
2014-02-07Add test for disabled dsmodeJoshua Harlow
2014-02-07Add a bunch of new testsJoshua Harlow
2014-02-01Don't forget the rest of the files!Joshua Harlow