1. 17 Sep, 2018 1 commit
  2. 25 Sep, 2017 1 commit
  3. 22 Jul, 2017 2 commits
  4. 04 Jan, 2017 3 commits
  5. 22 Dec, 2016 1 commit
    • Jon Grimm's avatar
      LICENSE: Allow dual licensing GPL-3 or Apache 2.0 · b2a9f336
      Jon Grimm authored
      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.
      b2a9f336
  6. 21 Dec, 2016 1 commit
  7. 19 Dec, 2016 2 commits
    • Scott Moser's avatar
      network: add ENI unit test for statically rendered routes. · 07156319
      Scott Moser authored
      This just adds a unit test for a case found to be failing in curtin.
      The issue was reported under bug 1649652.
      07156319
    • Scott Moser's avatar
      user-groups: fix bug when groups was provided as string and had spaces · ca3ae672
      Scott Moser authored
      Cloud-config provided like:
        users:
          - default
          - name: foobar
            groups: sudo, adm
      
      Would result in adduser being called as:
        useradd foobar --groups 'sudo, adm' -m
      Which would cause error:
        useradd: group ' adm' does not exist
      
      The fix here is just to always normalize groups and remove whitespace.
      
      Additionally a fix and unit tests to explicitly set system=False
      or no_create_home=True.  Previously those paths did not test the value
      of the entry, only the presense of the entry.
      
      LP: #1354694
      ca3ae672
  8. 12 Dec, 2016 1 commit
  9. 04 Dec, 2016 3 commits
  10. 02 Dec, 2016 2 commits
  11. 23 Nov, 2016 1 commit
  12. 22 Nov, 2016 6 commits
    • Scott Moser's avatar
      net/cmdline: Consider ip= or ip6= on command line not only ip= · 6e92c5f2
      Scott Moser authored
      The previous behavior would miss ip6= on the command line and
      would not pay attention to the written net-* or net6-* files if
      only ip6= was found.
      
      The fix here enables parsing the files if either ip= or ip6= is found,
      and adds some tests as well.
      
      LP: #1639930
      6e92c5f2
    • Wesley Wiedenmeier's avatar
      Improve formatting for ProcessExecutionError · 0fd1dd02
      Wesley Wiedenmeier authored
      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.
      0fd1dd02
    • Scott Moser's avatar
      flake8: fix trailing white space · bc4d9c59
      Scott Moser authored
      bc4d9c59
    • Brent Baude's avatar
      cloudinit/config/cc_rh_subscription.py: Remove repos before adding · edd94ebf
      Brent Baude authored
      A user has pointed out that upon set up of a machine, users typically
      remove repos (sometimes all of them) and then add repos in. This does
      make sense for a typical user.
      edd94ebf
    • Scott Moser's avatar
      Azure: No longer rely on walinux agent. · 677b85ab
      Scott Moser authored
      Cloud-init has for some time relied on walinuxagent to do some bits
      of work necessary for instance initialization.  That reliance has
      not been needed for a while, but we have still defaulted to it.
      
      This change uses the "builtin" path that Daniel Watkins added
      some time ago by default.  Also, Adjust tests that assumed the
      non-__builtin__ Azure agent_command.
      
      LP: #1538522
      677b85ab
    • Daniel Watkins's avatar
      disk_setup: Use sectors as unit when formatting MBR disks with sfdisk. · 18203bf1
      Daniel Watkins authored
      The version of sfdisk in wily (and onwards) only accepts sectors as a
      valid disk size. As such, this refactors the MBR code path in
      cc_disk_setup to use sectors.
      
       - use --unit=S: while newer versions of sfdisk assume --unit=S, older
         versions do not so we specifically pass it in.  Versions of sfdisk
         found in supported OSes such as centos6 wont assume --unit=S.
       - add --force: this exists back to centos 6 (2.17.2), so it should
         be fine, and is what we ultimately want.
         "do what I say, even if it is stupid"
       - keep --Linux.  Even though this has been deprecated for quite some
         time, we keep it until versions that want it are unsupported.
         If necessary at some point we could check for util linux version
         and if it had --Linux and use it in those cases.
      
      Additionally, improve usefulness of some log messages.
      
      LP: #1460715
      18203bf1
  13. 21 Nov, 2016 3 commits
  14. 18 Nov, 2016 1 commit
    • Scott Moser's avatar
      Add activate_datasource, for datasource specific code paths. · 9e904bbc
      Scott Moser authored
      This adds a call to 'activate_datasource'.  That will be called
      during init stage (or init-local in the event of a 'local' dsmode).
      It is present so that the datasource can do platform specific operations
      that may be necessary.  It is passed the fully rendered cloud-config
      and whether or not the instance is a new instance.
      
      The Azure datasource uses this to address formatting of the ephemeral
      devices.  It does so by
       a.) waiting for the device to come online
       b.) removing the marker files for the disk_setup and mounts modules
           if it finds that the ephemeral device has been reset.
      
      LP: #1611074
      9e904bbc
  15. 07 Nov, 2016 1 commit
  16. 01 Nov, 2016 2 commits
  17. 24 Oct, 2016 1 commit
    • Scott Moser's avatar
      unittests: do not read system /etc/cloud/cloud.cfg.d · 1e55f412
      Scott Moser authored
      Many of the unit tests in test_data would inadvertantly read the
      system's /etc/cloud/cloud.cfg and /etc/cloud/cloud.cfg.d.
      This was first noticed on a system deployed by MAAS, where
      files in /etc/cloud/cloud.cfg.d/ are root read-only.
      
      This changes those tests to actually make use of
      FilesystemMockingTestCase functionality and adds 'reRoot()' to that
      class which is easier to use for at least this use case.
      
      LP: #1635350
      1e55f412
  18. 20 Oct, 2016 3 commits
    • Ryan Harper's avatar
      Add support for snap create-user on Ubuntu Core images. · d8534561
      Ryan Harper authored
      Ubuntu Core images use the `snap create-user` to add users to an
      Ubuntu Core system. Add support for creating snap users by adding
      a key to the users dictionary.
        users:
          - name: bob
            snapuser: bob@bobcom.io
      
      Or via the 'snappy' dictionary:
        snappy:
          email: bob@bobcom.io
      
      Users may also create a snap user without contacting the SSO by
      providing a 'system-user' assertion by importing them into snapd.
      
      Additionally, Ubuntu Core systems have a read-only /etc/passwd such that
      the normal useradd/groupadd commands do not function without an additional
      flag, '--extrausers', which redirects the pwd to /var/lib/extrausers.
      
      Move the system_is_snappy() check from cc_snappy module to util for
      re-use and then update the Distro class to append '--extrausers' if
      the system is Ubuntu Core.
      d8534561
    • Scott Moser's avatar
      OpenNebula: replace 'ip' parsing with cloudinit.net usage. · 9972d246
      Scott Moser authored
      Replace the parsing of 'ip' to get a link and mac address list
      in OpenNebula's datasource with usage of cloudinit.net.
      
      This makes test cases there not depend on 'ip' availability
      and also uses common code.
      9972d246
    • Scott Moser's avatar
      Fix python2.6 things found running in centos 6. · e8730078
      Scott Moser authored
      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.
      e8730078
  19. 19 Oct, 2016 1 commit
    • Joshua Harlow's avatar
      Move user/group functions to new ug_util file · f0747c4b
      Joshua Harlow authored
      The amount of code to do user and group normalization
      and extraction deserves its own file so move the code
      that does this to a new file and update references to the
      old location.
      
      This removes some of the funkyness done in config modules
      to avoid namespace and attribute clashes as well.
      f0747c4b
  20. 07 Oct, 2016 1 commit
    • Scott Moser's avatar
      tests: silence the Cheetah UserWarning about NameMapper C version. · c4aeba3f
      Scott Moser authored
      This silences a warning made by Cheetah in pip installed environments:
        UserWarning: You don't have the C version of NameMapper installed!
        I'm disabling Cheetah's useStackFrames option ...
      
      The reason for the monkey patching is that the warning goes to stderr
      during nose and breaks up its expected output.  The side affect of it
      is that tests would run with Cheetah's 'useStackFrames'
      enabled which is "painfully slow with the Python version of NameMapper".
      c4aeba3f
  21. 04 Oct, 2016 1 commit
  22. 29 Sep, 2016 2 commits
    • Stéphane Graber's avatar
      lxd: Update network config for LXD 2.3 · 02f6c4bb
      Stéphane Graber authored
      Prior to LXD 2.3, the bridge configuration was done through distro
      packaging.  Thus, lxd module interacted with debconf.
      With 2.3 and higher, this is now done inside LXD itself, so we
      need to use "lxc network" there.
      
      For now, this perfectly matches what we had before with debconf and
      doesn't cover any of the new options. We can always add those later.
      
      A set of tests similar to what we had for debconf has been added to make
      sure things look good.
      
      This is tested in Yakkety container running LXD 2.3 and all options seem
      to be passed through as expected, giving me the bridge I defined.
      Signed-off-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
      02f6c4bb
    • Ben Howard's avatar
      DigitalOcean: use meta-data for network configruation · 9f83bb8e
      Ben Howard authored
      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.
      9f83bb8e