~larsks/cloud-init:feature/move-base-testcase

Last commit made on 2017-09-01
Get this branch:
git clone -b feature/move-base-testcase https://git.launchpad.net/~larsks/cloud-init
Only Lars Kellogg-Stedman can upload to this branch. If you are Lars Kellogg-Stedman please log in for upload directions.

Branch merges

Branch information

Name:
feature/move-base-testcase
Repository:
lp:~larsks/cloud-init

Recent commits

f5f64de... by Lars Kellogg-Stedman

pep8: previous commit resulted in pep8 and pylint issues

renaming the helpers module resulted in sort order changes in module
imports, which made flake8 sad. Touching the files also seems to have
flushed out some pre-existing pylint errors.

bd1374f... by Lars Kellogg-Stedman

tests: relocate tests/unittests/helpers.py to cloudinit/tests

This moves the base test case classes into into cloudinit/tests (and
updates all the corresponding imports)

fa266bf... by Scott Moser

upstart: do not package upstart jobs, drop ubuntu-init-switch module.

The ubuntu-init-switch module allowed the use to launch an instance that
was booted with upstart and have it switch its init system to systemd and
then reboot itself. It was only useful for the time period when Ubuntu was
transitioning to systemd but only produced images using upstart.

Also, do not run setup with --init-system=upstart. This means that by
default, debian packages built with packages/bddeb will not have upstart
unit files included. No other removal is done here.

1770a1e... by Chad Smith

tests: Stop leaking calls through unmocked metadata addresses

DataSourceEc2 behavior changed to first check a minimum acceptable
metadata version uri http://169.154.169.254/<min_version>/instance-id,
retrying on 404, until the metadata service is available. After the
metadata service is up, the datasource inspects preferred
extended_metadata_versions for availability. Unit tests only mocked the
preferred extended_metadata_version so all Ec2 tests were retrying
attempts against
http://169.254.169.254/meta-data/<min-version>/instance-id adding a lot of
time cost to the unit test runs.

This branch uses httpretty to properly mock the following:
  - 404s from metadata on undesired extended_metadata_version test routes
    - https://169.254.169.254/meta-data/2016-09-02/instance-id
  - full metadata dictionary represented on min_metadata_version
    - https://169.254.169.254/meta-data/2016-09-02/*

The branch also tightens httpretty to raise a MockError for any URL which
isn't mocked via httpretty.HTTPretty.allow_net_connect=False.

LP: #1714117

7e76c57... by Ryan Harper

distro: allow distro to specify a default locale

Currently the cloud-init default locale (en_US.UTF-8) is set by
the base datasource class. This patch allows a distro to overide
the fallback value with one that's available in the distro but continues
to respect an image which has preconfigured a locale.

- Distro object now has a get_locale method which will return a
  preconfigure locale setting by checking the distros locale system
  configuration file. If not set or not present, return the default
  locale of en_US.UTF-8 which retains behavior of all previous cloud-init
  releases.
- Apply locale now handles regenerating locales or system configuration
  files as needed.
- Adjust apply_locale logic to skip locale-regen if the specified LANG
  value is C.UTF-8,C, or POSIX; they do not require regeneration.
- Further add unittests to exercise the default paths for Ubuntu and
  non-ubuntu paths to validate they get the LANG expected.

300e451... by Scott Moser

tests: fix two recently added tests for sles distro.

test_set_locale_sles and test_set_locale_sles_default were incorrectly
testing for truth of <distro_object>.uses_systemd rather than calling
that function and checking its result.

The error was only seen if the system running the tests was not using
systemd.

b931a64... by Chad Smith

url_helper: dynamically import oauthlib import from inside oauth_headers

oauth_headers is the only function which requires oauthlib, move the
import and ImportError handling inside this function to only attempt
loading at runtime if called. This will allow us to build on platforms
that don't have python-oauthlib installed by default. Add simple unittests
around the missing oauthlib dependencies to make sure the function
performs as intended and raises and NotImplementedError if oauthlib can't
be imported.

502082f... by Scott Moser

tox: make xenial environment run with python3.6

The pinned versions of python packages in xenial do not work with
python3.6. Currently, the failure can be seen with:
 $ tox -e xenial tests/unittests/test_merging.py
which ends up failing with in /usr/lib/python3.6/inspect.py with:
  ValueError: Function has keyword-only parameters or annotations, use
  getfullargspec() API which can support them

Instead of setting 'basepython' to 3.5 for the 'xenial', we just update
the one package that does not run correctly with python3.6. That allows
the developer to have either python3.5 or python3.6 installed and have
tox work as expected.

cbda576... by Robert Schweikert

suse: Add support for openSUSE and return SLES to a working state.

This gets initial opensuse and SLES support back to a working state.
Still missing is more complete network file writing and unit tests.

44529c1... by Scott Moser

GCE: Add a main to the GCE Datasource.

This just adds a main to the GCE datasource so that it is easily
callable: python3 -m cloudinit.sources.DataSourceGCE
It also adds a log of the time it took to crawl.