Re: [Cloud-init-dev] [Merge] ~vorlon/cloud-init:master into cloud-init:master

2017-03-28 Thread Server Team CI bot
Review: Approve continuous-integration

PASSED: Continuous integration, rev:42d33bfda9cc83a6f2b18c51a543f4087c63471d
https://jenkins.ubuntu.com/server/job/cloud-init-ci/178/
Executed test runs:
SUCCESS: 
https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=metal-amd64/178
SUCCESS: 
https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=metal-arm64/178
SUCCESS: 
https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=metal-ppc64el/178
SUCCESS: 
https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=metal-s390x/178
SUCCESS: 
https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=vm-i386/178

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/178/rebuild

-- 
https://code.launchpad.net/~vorlon/cloud-init/+git/cloud-init/+merge/321245
Your team cloud init development team is requested to review the proposed merge 
of ~vorlon/cloud-init:master into cloud-init:master.

___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp


[Cloud-init-dev] [Merge] ~vorlon/cloud-init:master into cloud-init:master

2017-03-28 Thread Steve Langasek
Steve Langasek has proposed merging ~vorlon/cloud-init:master into 
cloud-init:master.

Requested reviews:
  cloud init development team (cloud-init-dev)

For more details, see:
https://code.launchpad.net/~vorlon/cloud-init/+git/cloud-init/+merge/321245

When booted without an initramfs, the root device will be /dev/root, not a 
named device.  There is partial support for this when resizing filesystems, but 
not for growing partitions, without which it doesn't do much good.  Move the 
/dev/root resolution code to util.py and use it from cc_growpart.py.

Also, booting without an initramfs only works with a root= argument that's 
either a kernel device name (which is unstable) or a partition UUID.  Handle 
the case of root=PARTUUID=value, not just LABEL and UUID.

-- 
Your team cloud init development team is requested to review the proposed merge 
of ~vorlon/cloud-init:master into cloud-init:master.
diff --git a/cloudinit/config/cc_growpart.py b/cloudinit/config/cc_growpart.py
index 832bb3f..089693e 100644
--- a/cloudinit/config/cc_growpart.py
+++ b/cloudinit/config/cc_growpart.py
@@ -247,7 +247,16 @@ def devent2dev(devent):
 result = util.get_mount_info(devent)
 if not result:
 raise ValueError("Could not determine device of '%s' % dev_ent")
-return result[0]
+dev = result[0]
+
+container = util.is_container()
+
+# Ensure the path is a block device.
+if (dev == "/dev/root" and not os.path.exists(dev) and not container):
+dev = util.rootdev_from_cmdline(util.get_cmdline())
+if dev is None:
+raise ValueError("Unable to find device '/dev/root'")
+return dev
 
 
 def resize_devices(resizer, devices):
diff --git a/cloudinit/config/cc_resizefs.py b/cloudinit/config/cc_resizefs.py
index e028abf..60e3ab5 100644
--- a/cloudinit/config/cc_resizefs.py
+++ b/cloudinit/config/cc_resizefs.py
@@ -71,25 +71,6 @@ RESIZE_FS_PREFIXES_CMDS = [
 NOBLOCK = "noblock"
 
 
-def rootdev_from_cmdline(cmdline):
-found = None
-for tok in cmdline.split():
-if tok.startswith("root="):
-found = tok[5:]
-break
-if found is None:
-return None
-
-if found.startswith("/dev/"):
-return found
-if found.startswith("LABEL="):
-return "/dev/disk/by-label/" + found[len("LABEL="):]
-if found.startswith("UUID="):
-return "/dev/disk/by-uuid/" + found[len("UUID="):]
-
-return "/dev/" + found
-
-
 def handle(name, cfg, _cloud, log, args):
 if len(args) != 0:
 resize_root = args[0]
@@ -121,7 +102,7 @@ def handle(name, cfg, _cloud, log, args):
 # Ensure the path is a block device.
 if (devpth == "/dev/root" and not os.path.exists(devpth) and
 not container):
-devpth = rootdev_from_cmdline(util.get_cmdline())
+devpth = util.rootdev_from_cmdline(util.get_cmdline())
 if devpth is None:
 log.warn("Unable to find device '/dev/root'")
 return
diff --git a/cloudinit/util.py b/cloudinit/util.py
index 3301957..bb17e3b 100644
--- a/cloudinit/util.py
+++ b/cloudinit/util.py
@@ -2382,4 +2382,26 @@ def indent(text, prefix):
 return ''.join(lines)
 
 
+def rootdev_from_cmdline(cmdline):
+found = None
+for tok in cmdline.split():
+if tok.startswith("root="):
+found = tok[5:]
+break
+if found is None:
+return None
+
+if found.startswith("/dev/"):
+return found
+if found.startswith("LABEL="):
+return "/dev/disk/by-label/" + found[len("LABEL="):]
+if found.startswith("UUID="):
+return "/dev/disk/by-uuid/" + found[len("UUID="):]
+if found.startswith("PARTUUID="):
+cmd = ['blkid', '-l', '-t', found, '-o', 'device']
+return subp(cmd, capture=True)[0].strip()
+
+return "/dev/" + found
+
+
 # vi: ts=4 expandtab
___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Cloud-init-dev] [Merge] ~raharper/cloud-init:fix-snap-user-doc into cloud-init:master

2017-03-28 Thread Server Team CI bot
Review: Approve continuous-integration

PASSED: Continuous integration, rev:6bef4ea4d28f8a72dc9b0353d67e6e16c47d133e
https://jenkins.ubuntu.com/server/job/cloud-init-ci/175/
Executed test runs:
SUCCESS: 
https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=metal-amd64/175
SUCCESS: 
https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=metal-arm64/175
SUCCESS: 
https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=metal-ppc64el/175
SUCCESS: 
https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=metal-s390x/175
SUCCESS: 
https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=vm-i386/175

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/175/rebuild

-- 
https://code.launchpad.net/~raharper/cloud-init/+git/cloud-init/+merge/321229
Your team cloud init development team is requested to review the proposed merge 
of ~raharper/cloud-init:fix-snap-user-doc into cloud-init:master.

___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp


[Cloud-init-dev] [Merge] ~raharper/cloud-init:fix-snap-user-doc into cloud-init:master

2017-03-28 Thread Ryan Harper
Ryan Harper has proposed merging ~raharper/cloud-init:fix-snap-user-doc into 
cloud-init:master.

Requested reviews:
  cloud init development team (cloud-init-dev)

For more details, see:
https://code.launchpad.net/~raharper/cloud-init/+git/cloud-init/+merge/321229

Add rtd entry for snap_config config module

Fix missing snap_config module documentation by adding it to
the modules list.  Update the documentation title so it does
not collide with existing snappy title.
-- 
Your team cloud init development team is requested to review the proposed merge 
of ~raharper/cloud-init:fix-snap-user-doc into cloud-init:master.
diff --git a/cloudinit/config/cc_snap_config.py b/cloudinit/config/cc_snap_config.py
index db51166..fe0cc73 100644
--- a/cloudinit/config/cc_snap_config.py
+++ b/cloudinit/config/cc_snap_config.py
@@ -5,8 +5,8 @@
 # This file is part of cloud-init. See LICENSE file for license information.
 
 """
-Snappy
---
+Snap Config
+---
 **Summary:** snap_config modules allows configuration of snapd.
 
 This module uses the same ``snappy`` namespace for configuration but
diff --git a/doc/rtd/topics/modules.rst b/doc/rtd/topics/modules.rst
index a3ead4f..c963c09 100644
--- a/doc/rtd/topics/modules.rst
+++ b/doc/rtd/topics/modules.rst
@@ -44,6 +44,7 @@ Modules
 .. automodule:: cloudinit.config.cc_set_hostname
 .. automodule:: cloudinit.config.cc_set_passwords
 .. automodule:: cloudinit.config.cc_snappy
+.. automodule:: cloudinit.config.cc_snap_config
 .. automodule:: cloudinit.config.cc_spacewalk
 .. automodule:: cloudinit.config.cc_ssh
 .. automodule:: cloudinit.config.cc_ssh_authkey_fingerprints
___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Cloud-init-dev] [Merge] ~raharper/cloud-init:net-v2-dont-print-udevadm-commands into cloud-init:master

2017-03-28 Thread Server Team CI bot
Review: Approve continuous-integration

PASSED: Continuous integration, rev:891ec47617cd4dd6068939a6403ba2115422dd7b
https://jenkins.ubuntu.com/server/job/cloud-init-ci/174/
Executed test runs:
SUCCESS: 
https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=metal-amd64/174
SUCCESS: 
https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=metal-arm64/174
SUCCESS: 
https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=metal-ppc64el/174
SUCCESS: 
https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=metal-s390x/174
SUCCESS: 
https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=vm-i386/174

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/174/rebuild

-- 
https://code.launchpad.net/~raharper/cloud-init/+git/cloud-init/+merge/321222
Your team cloud init development team is requested to review the proposed merge 
of ~raharper/cloud-init:net-v2-dont-print-udevadm-commands into 
cloud-init:master.

___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp


[Cloud-init-dev] [Merge] ~raharper/cloud-init:net-v2-dont-print-udevadm-commands into cloud-init:master

2017-03-28 Thread Ryan Harper
Ryan Harper has proposed merging 
~raharper/cloud-init:net-v2-dont-print-udevadm-commands into cloud-init:master.

Requested reviews:
  cloud init development team (cloud-init-dev)

For more details, see:
https://code.launchpad.net/~raharper/cloud-init/+git/cloud-init/+merge/321222

netplan: remove debugging prints, use logging instead

Remove debugging print statements.  Change a few to use
logging.debug() where useful.
-- 
Your team cloud init development team is requested to review the proposed merge 
of ~raharper/cloud-init:net-v2-dont-print-udevadm-commands into 
cloud-init:master.
diff --git a/cloudinit/net/netplan.py b/cloudinit/net/netplan.py
index cd93b21..7bf1021 100644
--- a/cloudinit/net/netplan.py
+++ b/cloudinit/net/netplan.py
@@ -1,6 +1,7 @@
 # This file is part of cloud-init.  See LICENSE file ...
 
 import copy
+import logging
 import os
 
 from . import renderer
@@ -10,6 +11,7 @@ from cloudinit import util
 from cloudinit.net import SYS_CLASS_NET, get_devicelist
 
 
+LOG = logging.getLogger(__name__)
 NET_CONFIG_TO_V2 = {
 'bond': {'bond-ad-select': 'ad-select',
  'bond-arp-interval': 'arp-interval',
@@ -186,7 +188,7 @@ class Renderer(renderer.Renderer):
 
 def _netplan_generate(self, run=False):
 if not run:
-print("netplan postcmd disabled")
+LOG.debug("netplan postcmd disabled")
 return
 util.subp(self.NETPLAN_GENERATE, capture=True)
 
@@ -196,17 +198,15 @@ class Renderer(renderer.Renderer):
the setup_link udev builtin command
 """
 if not run:
-print("netsetup postcmd disabled")
+LOG.debug("netsetup postcmd disabled")
 return
 setup_lnk = ['udevadm', 'test-builtin', 'net_setup_link']
 for cmd in [setup_lnk + [SYS_CLASS_NET + iface]
 for iface in get_devicelist() if
 os.path.islink(SYS_CLASS_NET + iface)]:
-print(cmd)
 util.subp(cmd, capture=True)
 
 def _render_content(self, network_state):
-print('rendering v2 for victory!')
 ethernets = {}
 wifis = {}
 bridges = {}
___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Cloud-init-dev] [Merge] ~smoser/cloud-init:bug/1675185-no-apt-on-snappy into cloud-init:master

2017-03-28 Thread Server Team CI bot
Review: Approve continuous-integration

PASSED: Continuous integration, rev:b735652a9fa1e448027e62d6fe7d2560507650a8
https://jenkins.ubuntu.com/server/job/cloud-init-ci/173/
Executed test runs:
SUCCESS: 
https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=metal-amd64/173
SUCCESS: 
https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=metal-arm64/173
SUCCESS: 
https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=metal-ppc64el/173
SUCCESS: 
https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=metal-s390x/173
SUCCESS: 
https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=vm-i386/173

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/173/rebuild

-- 
https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/321218
Your team cloud init development team is requested to review the proposed merge 
of ~smoser/cloud-init:bug/1675185-no-apt-on-snappy into cloud-init:master.

___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Cloud-init-dev] [Merge] ~smoser/cloud-init:bug/1675185-no-apt-on-snappy into cloud-init:master

2017-03-28 Thread Server Team CI bot
Review: Needs Fixing continuous-integration

FAILED: Continuous integration, rev:2643c41bd53b47ecf5f0a39b65ef771afdb4ebdf
https://jenkins.ubuntu.com/server/job/cloud-init-ci/172/
Executed test runs:
FAILURE: 
https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=metal-amd64/172/console
FAILURE: 
https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=metal-arm64/172/console
FAILURE: 
https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=metal-ppc64el/172/console
FAILURE: 
https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=metal-s390x/172/console
FAILURE: 
https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=vm-i386/172/console

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/172/rebuild

-- 
https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/321218
Your team cloud init development team is requested to review the proposed merge 
of ~smoser/cloud-init:bug/1675185-no-apt-on-snappy into cloud-init:master.

___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Cloud-init-dev] [Merge] ~smoser/cloud-init:bug/1675185-no-apt-on-snappy into cloud-init:master

2017-03-28 Thread Scott Moser
need some tests, and maybe some test case cleanups.
-- 
https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/321218
Your team cloud init development team is requested to review the proposed merge 
of ~smoser/cloud-init:bug/1675185-no-apt-on-snappy into cloud-init:master.

___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp


[Cloud-init-dev] [Merge] ~smoser/cloud-init:bug/1675185-no-apt-on-snappy into cloud-init:master

2017-03-28 Thread Scott Moser
Scott Moser has proposed merging 
~smoser/cloud-init:bug/1675185-no-apt-on-snappy into cloud-init:master.

Commit message:
apt_configure: run only when needed.

the apt_configure module would fail to run on snappy as it
tries to write to unwritable paths.  Additionally, there is no apt 
there, so no point.

This skips running on ubuntu core by 'is_snappy', because the check
for apt will pass as there is a wrapper that prints out a warning
there.

LP: #1675185

Requested reviews:
  cloud init development team (cloud-init-dev)
Related bugs:
  Bug #1675185 in cloud-init: "cannot disable apt_configure via cloud-config"
  https://bugs.launchpad.net/cloud-init/+bug/1675185

For more details, see:
https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/321218
-- 
Your team cloud init development team is requested to review the proposed merge 
of ~smoser/cloud-init:bug/1675185-no-apt-on-snappy into cloud-init:master.
diff --git a/cloudinit/config/cc_apt_configure.py b/cloudinit/config/cc_apt_configure.py
index 7f09c91..c2bbad1 100644
--- a/cloudinit/config/cc_apt_configure.py
+++ b/cloudinit/config/cc_apt_configure.py
@@ -280,13 +280,21 @@ def handle(name, ocfg, cloud, log, _):
 
 LOG.debug("handling apt (module %s) with apt config '%s'", name, cfg)
 
+apply_debconf_selections(cfg, target)
+
+if util.system_is_snappy():
+LOG.debug("No apt configuration on snappy.")
+return
+
+if (not util.which('apt-get') or util.which('apt')):
+LOG.debug("No apt-get or apt, not configuring apt")
+return
+
 release = util.lsb_release(target=target)['codename']
 arch = util.get_architecture(target)
 mirrors = find_apt_mirror_info(cfg, cloud, arch=arch)
 LOG.debug("Apt Mirror info: %s", mirrors)
 
-apply_debconf_selections(cfg, target)
-
 if util.is_false(cfg.get('preserve_sources_list', False)):
 generate_sources_list(cfg, release, mirrors, cloud)
 rename_apt_lists(mirrors, target)
___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp


[Cloud-init-dev] [Merge] ~smoser/cloud-init:bug/1675185-no-apt-on-snappy into cloud-init:master

2017-03-28 Thread Scott Moser
The proposal to merge ~smoser/cloud-init:bug/1675185-no-apt-on-snappy into 
cloud-init:master has been updated.

Commit Message changed to:

apt_configure: run only when needed.

the apt_configure module would fail to run on snappy as it
tries to write to unwritable paths.  Additionally, there is no apt 
there, so no point.

This skips running on ubuntu core by 'is_snappy', because the check
for apt will pass as there is a wrapper that prints out a warning
there.

LP: #1675185

For more details, see:
https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/321218
-- 
Your team cloud init development team is requested to review the proposed merge 
of ~smoser/cloud-init:bug/1675185-no-apt-on-snappy into cloud-init:master.

___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Cloud-init-dev] [Merge] ~smoser/cloud-init:bug/ds-identify-none-twice into cloud-init:master

2017-03-28 Thread Server Team CI bot
Review: Approve continuous-integration

PASSED: Continuous integration, rev:841f1fc340f3827b74a3348c5e3531c0e7504949
https://jenkins.ubuntu.com/server/job/cloud-init-ci/171/
Executed test runs:
SUCCESS: 
https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=metal-amd64/171
SUCCESS: 
https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=metal-arm64/171
SUCCESS: 
https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=metal-ppc64el/171
SUCCESS: 
https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=metal-s390x/171
SUCCESS: 
https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=vm-i386/171

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/171/rebuild

-- 
https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/321208
Your team cloud init development team is requested to review the proposed merge 
of ~smoser/cloud-init:bug/ds-identify-none-twice into cloud-init:master.

___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp


[Cloud-init-dev] [Merge] ~smoser/cloud-init:bug/ds-identify-none-twice into cloud-init:master

2017-03-28 Thread Scott Moser
Scott Moser has proposed merging ~smoser/cloud-init:bug/ds-identify-none-twice 
into cloud-init:master.

Commit message:
ds-identify: do not write None twice to datasource_list.

If the only the None datasource was listed in datasource_list, then
ds-identify would write a cloud.cfg witih:
 datasource_list: [None, None]

The fix is to just append None if the list only has None.

Requested reviews:
  Dan Watkins (daniel-thewatkins)
  cloud init development team (cloud-init-dev)

For more details, see:
https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/321208
-- 
Your team cloud init development team is requested to review the proposed merge 
of ~smoser/cloud-init:bug/ds-identify-none-twice into cloud-init:master.
diff --git a/tools/ds-identify b/tools/ds-identify
index 3010634..54bd999 100755
--- a/tools/ds-identify
+++ b/tools/ds-identify
@@ -954,7 +954,9 @@ found() {
 shift
 fi
 # always write the None datasource last.
-list="${list:+${list}, }None"
+if [ "$list" != "None" ]; then
+list="${list:+${list}, }None"
+fi
 write_result "datasource_list: [ $list ]" "$@"
 return
 }
___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp


[Cloud-init-dev] [Merge] ~smoser/cloud-init:bug/ds-identify-none-twice into cloud-init:master

2017-03-28 Thread Scott Moser
The proposal to merge ~smoser/cloud-init:bug/ds-identify-none-twice into 
cloud-init:master has been updated.

Commit Message changed to:

ds-identify: do not write None twice to datasource_list.

If the only the None datasource was listed in datasource_list, then
ds-identify would write a cloud.cfg witih:
 datasource_list: [None, None]

The fix is to just append None if the list only has None.

For more details, see:
https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/321208
-- 
Your team cloud init development team is requested to review the proposed merge 
of ~smoser/cloud-init:bug/ds-identify-none-twice into cloud-init:master.

___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp


[Cloud-init-dev] [Merge] ~smoser/cloud-init:bug/1675349-openstack-finnish-nebula into cloud-init:master

2017-03-28 Thread noreply
The proposal to merge ~smoser/cloud-init:bug/1675349-openstack-finnish-nebula 
into cloud-init:master has been updated.

Status: Needs review => Merged

For more details, see:
https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/321104
-- 
Your team cloud init development team is requested to review the proposed merge 
of ~smoser/cloud-init:bug/1675349-openstack-finnish-nebula into 
cloud-init:master.

___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Cloud-init-dev] [Merge] ~utlemming/cloud-init:lp-1676908 into cloud-init:master

2017-03-28 Thread Server Team CI bot
Review: Approve continuous-integration

PASSED: Continuous integration, rev:ca7acab88e42d8861ea00b2e1ca12fb58ea7a7bb
https://jenkins.ubuntu.com/server/job/cloud-init-ci/170/
Executed test runs:
SUCCESS: 
https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=metal-amd64/170
SUCCESS: 
https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=metal-arm64/170
SUCCESS: 
https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=metal-ppc64el/170
SUCCESS: 
https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=metal-s390x/170
SUCCESS: 
https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=vm-i386/170

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/170/rebuild

-- 
https://code.launchpad.net/~utlemming/cloud-init/+git/cloud-init-1/+merge/321183
Your team cloud init development team is requested to review the proposed merge 
of ~utlemming/cloud-init:lp-1676908 into cloud-init:master.

___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp


[Cloud-init-dev] [Merge] ~smoser/cloud-init:bug/1674861-ds-identify-gce into cloud-init:master

2017-03-28 Thread noreply
The proposal to merge ~smoser/cloud-init:bug/1674861-ds-identify-gce into 
cloud-init:master has been updated.

Status: Needs review => Merged

For more details, see:
https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/321094
-- 
Your team cloud init development team is requested to review the proposed merge 
of ~smoser/cloud-init:bug/1674861-ds-identify-gce into cloud-init:master.

___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp


[Cloud-init-dev] [Merge] ~utlemming/cloud-init:lp-1676908 into cloud-init:master

2017-03-28 Thread Ben Howard
Ben Howard has proposed merging ~utlemming/cloud-init:lp-1676908 into 
cloud-init:master.

Requested reviews:
  cloud init development team (cloud-init-dev)
Related bugs:
  Bug #1676908 in cloud-init: "DigitalOcean network improvements"
  https://bugs.launchpad.net/cloud-init/+bug/1676908

For more details, see:
https://code.launchpad.net/~utlemming/cloud-init/+git/cloud-init-1/+merge/321183

This is a request to merge the improvements to the linked PR that improves the 
DigitalOcean datasource.

The changes:
- No longer bind the nameservers to a specific interface to bring it inline 
with the other DataSources like OpenStack and SmartOS.
- Fix mis-binding the IPV4all address to a secondary interface by considering 
'eth0' or 'ens3' first
- Consider all network definitions, not just 'public' or 'private'.
-- 
Your team cloud init development team is requested to review the proposed merge 
of ~utlemming/cloud-init:lp-1676908 into cloud-init:master.
diff --git a/cloudinit/sources/helpers/digitalocean.py b/cloudinit/sources/helpers/digitalocean.py
index 72f7bde..a9f1816 100644
--- a/cloudinit/sources/helpers/digitalocean.py
+++ b/cloudinit/sources/helpers/digitalocean.py
@@ -10,6 +10,7 @@ from cloudinit import net as cloudnet
 from cloudinit import url_helper
 from cloudinit import util
 
+FIRST_NICS = ['eth0', 'ens3']
 NIC_MAP = {'public': 'eth0', 'private': 'eth1'}
 
 LOG = logging.getLogger(__name__)
@@ -22,8 +23,13 @@ def assign_ipv4_link_local(nic=None):
address is random.
 """
 
+# if there is an eth0, then it has already been mapped from ens3 to eth0
+c_devs = FIRST_NICS
+c_devs.extend([x for x in sorted(cloudnet.get_devicelist())
+   if x not in FIRST_NICS])
+
 if not nic:
-for cdev in sorted(cloudnet.get_devicelist()):
+for cdev in c_devs:
 if cloudnet.is_physical(cdev):
 nic = cdev
 LOG.debug("assigned nic '%s' for link-local discovery", nic)
@@ -107,15 +113,12 @@ def convert_network_configuration(config, dns_servers):
 }
 """
 
-def _get_subnet_part(pcfg, nameservers=None):
+def _get_subnet_part(pcfg):
 subpart = {'type': 'static',
'control': 'auto',
'address': pcfg.get('ip_address'),
'gateway': pcfg.get('gateway')}
 
-if nameservers:
-subpart['dns_nameservers'] = nameservers
-
 if ":" in pcfg.get('ip_address'):
 subpart['address'] = "{0}/{1}".format(pcfg.get('ip_address'),
   pcfg.get('cidr'))
@@ -124,15 +127,13 @@ def convert_network_configuration(config, dns_servers):
 
 return subpart
 
-all_nics = []
-for k in ('public', 'private'):
-if k in config:
-all_nics.extend(config[k])
-
-macs_to_nics = cloudnet.get_interfaces_by_mac()
 nic_configs = []
+macs_to_nics = cloudnet.get_interfaces_by_mac()
+LOG.debug("nic mapping: %s", macs_to_nics)
 
-for nic in all_nics:
+for n in config:
+nic = config[n][0]
+LOG.debug("considering %s", nic)
 
 mac_address = nic.get('mac')
 sysfs_name = macs_to_nics.get(mac_address)
@@ -157,13 +158,8 @@ def convert_network_configuration(config, dns_servers):
 continue
 
 sub_part = _get_subnet_part(raw_subnet)
-if nic_type == 'public' and 'anchor' not in netdef:
-# add DNS resolvers to the public interfaces only
-sub_part = _get_subnet_part(raw_subnet, dns_servers)
-else:
-# remove the gateway any non-public interfaces
-if 'gateway' in sub_part:
-del sub_part['gateway']
+if netdef in ('private', 'anchor_ipv4', 'anchor_ipv6'):
+del sub_part['gateway']
 
 subnets.append(sub_part)
 
@@ -171,6 +167,10 @@ def convert_network_configuration(config, dns_servers):
 nic_configs.append(ncfg)
 LOG.debug("nic '%s' configuration: %s", if_name, ncfg)
 
+if dns_servers:
+LOG.debug("added dns servers")
+nic_configs.append({'type': 'nameserver', 'address': dns_servers})
+
 return {'version': 1, 'config': nic_configs}
 
 
diff --git a/tests/unittests/test_datasource/test_digitalocean.py b/tests/unittests/test_datasource/test_digitalocean.py
index 9be6bc1..c022e05 100644
--- a/tests/unittests/test_datasource/test_digitalocean.py
+++ b/tests/unittests/test_datasource/test_digitalocean.py
@@ -204,17 +204,24 @@ class TestNetworkConvert(TestCase):
 netcfg = self._get_networking()
 self.assertIsNotNone(netcfg)
 
-for nic_def in netcfg.get('config'):
-print(json.dumps(nic_def, indent=3))
-n_type = nic_def.get('type')
-n_subnets = nic_def.get('type')
-n_name = nic_def.get('name')
-n_mac = nic_def.get('mac_address')
+for part in net

[Cloud-init-dev] [Merge] ~utlemming/cloud-init:lp-1676908 into cloud-init:master

2017-03-28 Thread Ben Howard
The proposal to merge ~utlemming/cloud-init:lp-1676908 into cloud-init:master 
has been updated.

Description changed to:

This is a request to merge the improvements to the DigitalOcean datasource.

The changes:
- No longer bind the nameservers to a specific interface to bring it inline 
with the other DataSources like OpenStack and SmartOS.
- Fix mis-binding the IPV4all address to a secondary interface by considering 
'eth0' or 'ens3' first
- Consider all network definitions, not just 'public' or 'private'.

For more details, see:
https://code.launchpad.net/~utlemming/cloud-init/+git/cloud-init-1/+merge/321183
-- 
Your team cloud init development team is requested to review the proposed merge 
of ~utlemming/cloud-init:lp-1676908 into cloud-init:master.

___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp