[Cloud-init-dev] [Merge] ~rjschwei/cloud-init:baseNetConfTestSUSE into cloud-init:master
The proposal to merge ~rjschwei/cloud-init:baseNetConfTestSUSE into cloud-init:master has been updated. Status: Approved => Merged For more details, see: https://code.launchpad.net/~rjschwei/cloud-init/+git/cloud-init/+merge/333772 -- Your team cloud-init commiters is requested to review the proposed merge of ~rjschwei/cloud-init:baseNetConfTestSUSE 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] ~rjschwei/cloud-init:baseNetConfTestSUSE into cloud-init:master
The proposal to merge ~rjschwei/cloud-init:baseNetConfTestSUSE into cloud-init:master has been updated. Status: Needs review => Approved For more details, see: https://code.launchpad.net/~rjschwei/cloud-init/+git/cloud-init/+merge/333772 -- Your team cloud-init commiters is requested to review the proposed merge of ~rjschwei/cloud-init:baseNetConfTestSUSE 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] ~penick/cloud-init:handle_uppercase_labels into cloud-init:master
CLA Signed, thanks! -- https://code.launchpad.net/~penick/cloud-init/+git/cloud-init/+merge/335286 Your team cloud-init commiters is requested to review the proposed merge of ~penick/cloud-init:handle_uppercase_labels 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] ~chad.smith/cloud-init:azure-no-ifupdown into cloud-init:master
The proposal to merge ~chad.smith/cloud-init:azure-no-ifupdown into cloud-init:master has been updated. Commit Message changed to: escription of the Change azure: Don't bounce network with ifdown ifup when those tools don't exist This fixes a traceback when attempting to bounce the network after hostname resets. In artful and bionic ifupdown package is no longer installed in default cloudimages. As such, Azure can't use those tools to bounce the network informing DDNS about hostname changes. This doesn't affect DDNS updates though because systemd-networkd is now watching hostname deltas and with default behavior to SendHostname=True over dhcp for all hostname updates which publishes DDNS for us. LP: #1722668 For more details, see: https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/335470 -- Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:azure-no-ifupdown 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] ~chad.smith/cloud-init:azure-no-ifupdown into cloud-init:master
The proposal to merge ~chad.smith/cloud-init:azure-no-ifupdown into cloud-init:master has been updated. Commit Message changed to: azure: Don't bounce network with ifdown ifup when those tools don't exist This fixes a traceback when attempting to bounce the network after hostname resets. In artful and bionic ifupdown package is no longer installed in default cloudimages. As such, Azure can't use those tools to bounce the network informing DDNS about hostname changes. This doesn't affect DDNS updates though because systemd-networkd is now watching hostname deltas and with default behavior to SendHostname=True over dhcp for all hostname updates which publishes DDNS for us. LP: #1722668 For more details, see: https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/335470 -- Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:azure-no-ifupdown 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] ~chad.smith/cloud-init:azure-no-ifupdown into cloud-init:master
The proposal to merge ~chad.smith/cloud-init:azure-no-ifupdown into cloud-init:master has been updated. Description changed to: azure: Don't bounce network with ifdown ifup when those tools don't exist This fixes a traceback when attempting to bounce the network after hostname resets. In artful and bionic ifupdown package is no longer installed in default cloudimages. As such, Azure can't use those tools to bounce the network informing DDNS about hostname changes. This doesn't affect DDNS updates though because systemd-networkd is now watching hostname deltas and with default behavior to SendHostname=True over dhcp for all hostname updates which publishes DDNS for us. LP: #1722668 For more details, see: https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/335470 -- Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:azure-no-ifupdown 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] ~chad.smith/cloud-init:azure-no-ifupdown into cloud-init:master
Review: Approve continuous-integration PASSED: Continuous integration, rev:6d567fe2e563f27412b4c6527eb12f57c81aeeea https://jenkins.ubuntu.com/server/job/cloud-init-ci/651/ Executed test runs: SUCCESS: Checkout SUCCESS: Unit & Style Tests SUCCESS: Ubuntu LTS: Build SUCCESS: Ubuntu LTS: Integration SUCCESS: MAAS Compatability Testing IN_PROGRESS: Declarative: Post Actions Click here to trigger a rebuild: https://jenkins.ubuntu.com/server/job/cloud-init-ci/651/rebuild -- https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/335470 Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:azure-no-ifupdown 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] ~chad.smith/cloud-init:azure-no-ifupdown into cloud-init:master
Review: Needs Fixing continuous-integration FAILED: Continuous integration, rev:74fb5bb7fdd46d7067e371833499131dfde14b30 https://jenkins.ubuntu.com/server/job/cloud-init-ci/650/ Executed test runs: SUCCESS: Checkout SUCCESS: Unit & Style Tests FAILED: Ubuntu LTS: Build Click here to trigger a rebuild: https://jenkins.ubuntu.com/server/job/cloud-init-ci/650/rebuild -- https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/335470 Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:azure-no-ifupdown 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] ~rjschwei/cloud-init:baseNetConfTestSUSE into cloud-init:master
Review: Approve Diff comments: > diff --git a/tests/unittests/test_distros/test_netconfig.py > b/tests/unittests/test_distros/test_netconfig.py > index 8d0b263..9a62b71 100644 > --- a/tests/unittests/test_distros/test_netconfig.py > +++ b/tests/unittests/test_distros/test_netconfig.py > @@ -771,4 +772,46 @@ ifconfig_vtnet0="DHCP" > self.assertCfgEquals(expected_buf, str(write_buf)) > self.assertEqual(write_buf.mode, 0o644) > > +def test_simple_write_oopensuse(self): > +"""Opensuse network rendering writes appropriate sysconfg files.""" > +tmpdir = self.tmp_dir() > +self.patchOS(tmpdir) Ahh thanks for the tip here. Will do in the future. > +self.patchUtils(tmpdir) > +distro = self._get_distro('opensuse') > + > +distro.apply_network(BASE_NET_CFG, False) > + > +lo_path = os.path.join(tmpdir, 'etc/sysconfig/network/ifcfg-lo') > +eth0_path = os.path.join(tmpdir, 'etc/sysconfig/network/ifcfg-eth0') > +eth1_path = os.path.join(tmpdir, 'etc/sysconfig/network/ifcfg-eth1') > +expected_cfgs = { > +lo_path: dedent(''' > +STARTMODE="auto" > +USERCONTROL="no" > +FIREWALL="no" > +'''), > +eth0_path: dedent(''' > +BOOTPROTO="static" > +BROADCAST="192.168.1.0" > +GATEWAY="192.168.1.254" > +IPADDR="192.168.1.5" > +NETMASK="255.255.255.0" > +STARTMODE="auto" > +USERCONTROL="no" > +ETHTOOL_OPTIONS="" > +'''), > +eth1_path: dedent(''' > +BOOTPROTO="dhcp" > +STARTMODE="auto" > +USERCONTROL="no" > +ETHTOOL_OPTIONS="" > +''') > +} > +for cfgpath in (lo_path, eth0_path, eth1_path): > +self.assertCfgEquals( > +expected_cfgs[cfgpath], > +util.load_file(cfgpath)) > +file_stat = os.stat(cfgpath) > +self.assertEqual(0o644, stat.S_IMODE(file_stat.st_mode)) > + > # vi: ts=4 expandtab -- https://code.launchpad.net/~rjschwei/cloud-init/+git/cloud-init/+merge/333772 Your team cloud-init commiters is requested to review the proposed merge of ~rjschwei/cloud-init:baseNetConfTestSUSE 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] ~chad.smith/cloud-init:azure-no-ifupdown into cloud-init:master
Review: Needs Fixing continuous-integration FAILED: Continuous integration, rev:c092c12f606dd5a92e0f80db35a1cb4b8b5c1dcb https://jenkins.ubuntu.com/server/job/cloud-init-ci/649/ Executed test runs: SUCCESS: Checkout SUCCESS: Unit & Style Tests FAILED: Ubuntu LTS: Build Click here to trigger a rebuild: https://jenkins.ubuntu.com/server/job/cloud-init-ci/649/rebuild -- https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/335470 Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:azure-no-ifupdown 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] ~chad.smith/cloud-init:azure-no-ifupdown into cloud-init:master
Diff comments: > diff --git a/cloudinit/sources/DataSourceAzure.py > b/cloudinit/sources/DataSourceAzure.py > index e73b57b..a56ced2 100644 > --- a/cloudinit/sources/DataSourceAzure.py > +++ b/cloudinit/sources/DataSourceAzure.py > @@ -591,6 +591,18 @@ def address_ephemeral_resize(devpath=RESOURCE_DISK_PATH, > maxwait=120, > return > > > +def _is_bounce_command_missing_dependency(command): > +'''Return True if bounce command is unsupported.''' > +if isinstance(command, (list, tuple)): it seems an arbitrary false positive on _is_bounce_command_missing_dependency(["sh", "-c", "echo here you could call ifdown, but we will not."]) possibly contrived, but really i think i'm ok to just ditch this functionality. only ever calling the bounce command if there is an ifup and an ifdown. that seems arbitrary as well, but i suspect that there are no users that specify their own that do not use a username of 'smoser'. > +for item in command: > +if 'ifdown' in item and not util.which('ifdown'): > +return True > +else: > +if 'ifdown' in command and not util.which('ifdown'): > +return True > +return False > + > + > def perform_hostname_bounce(hostname, cfg, prev_hostname): > # set the hostname to 'hostname' if it is not already set to that. > # then, if policy is not off, bounce the interface using command -- https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/335470 Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:azure-no-ifupdown 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] ~powersj/cloud-init:cii-enable-ec2 into cloud-init:master
* (from the commit message). "The default instance type is set to t2.micro. This is the smallest type that will work for both ebs and instance-store." that is not true. per https://aws.amazon.com/ec2/instance-types/ t2.* are 'EBS-only'. * user-data, I think probably you should pass None if there is None. I expect that boto is not just checking a true-ish value. I know from experience that running an instance with '' as user-data differs from None (in the former you do not get a 'user-data' field in the meta-data service, in the latter you do get one). it looks like you need to not pass UserData in the kwargs at all. https://github.com/boto/botocore/blob/develop/botocore/handlers.py#L528 * last... i dont need this, but it woudl be nice if you (re)started the EC2Image._instance() only when necessary. Rather than right after snapshot. Just because i think most probable use case is to not ever restart it. that also tells us passing bytes (rather than string) is ok, and that boto will always base64 encode for you. * Lets add a console_log() to the EC2Instance please. http://boto3.readthedocs.io/en/latest/reference/services/ec2.html#EC2.Instance.console_output Diff comments: > diff --git a/tests/cloud_tests/platforms/ec2/image.py > b/tests/cloud_tests/platforms/ec2/image.py > new file mode 100644 > index 000..dab8601 > --- /dev/null > +++ b/tests/cloud_tests/platforms/ec2/image.py > @@ -0,0 +1,115 @@ > +# This file is part of cloud-init. See LICENSE file for license information. > + > +"""EC2 Image Base Class.""" > + > +from ..images import Image > +from .snapshot import EC2Snapshot > +from tests.cloud_tests import LOG > + > + > +class EC2Image(Image): > +"""EC2 backed image.""" > + > +platform_name = 'ec2' > + > +def __init__(self, platform, config, image_ami): > +"""Set up image. > + > +@param platform: platform object > +@param config: image configuration > +@param image_ami: string of image ami ID > +""" > +super(EC2Image, self).__init__(platform, config) > +self._img_instance = None > +self.image_ami = image_ami > +self.image_ami_edited = False > + > +@property > +def _instance(self): > +"""Internal use only, returns a running instance""" > +if not self._img_instance: > +self._img_instance = self.platform.create_instance( > +self.properties, self.config, self.features, > +self.image_ami, user_data=None) > +self._img_instance.start(wait=True, wait_for_cloud_init=True) > +return self._img_instance > + > +@property > +def properties(self): > +"""Dictionary containing: 'arch', 'os', 'version', 'release'.""" > +return { > +'arch': self.config['arch'], > +'os': self.config['family'], > +'release': self.config['release'], > +'version': self.config['version'], > +} > + > +def destroy(self): > +"""Deregister (delete) a custom AMI on EC2. > + > +This does not delete any instances, only removes the saved AMI. > + > +The removal of the images and all other items is handled by the > +framework. In some cases we want to keep the images, so let the > +framework decide whether to keep or destroy everything. > +""" > +if self.image_ami_edited: I think what you *should* be doing here is destroying the instance. the image_ami_edited is a reference to a snapshot that was created based on this image. that is completely detached from this image, and destroying an EC2Image should not remove snapshots made from it. In the NoCloud platform, the Image is a thing on disk locally, so destroying it will remove that local file. But in the EC2 case, the Image is really just a ami-id with possibly a instance associated with it. does that make sense? > +LOG.debug('removing custom AMI') > +self.platform.ec2_client.deregister_image( > +ImageId=self.image_ami_edited > +) > + > +super(EC2Image, self).destroy() > + > +def _execute(self, *args, **kwargs): > +"""Execute command in image, modifying image.""" > +return self._instance._execute(*args, **kwargs) > + > +def push_file(self, local_path, remote_path): > +"""Copy file at 'local_path' to instance at 'remote_path'.""" > +return self._instance.push_file(local_path, remote_path) > + > +def run_script(self, *args, **kwargs): > +"""Run script in image, modifying image. > + > +@return_value: script output > +""" > +return self._instance.run_script(*args, **kwargs) > + > +def snapshot(self): > +"""Create snapshot of image, block until done. > + > +Will return base image_ami if no instance has been booted, otherwise > +will run the clean script, shutdown the
Re: [Cloud-init-dev] [Merge] ~chad.smith/cloud-init:azure-no-ifupdown into cloud-init:master
Review: Needs Fixing continuous-integration FAILED: Continuous integration, rev:74f546422a0382e5b5782762b0db8be8339d48e3 https://jenkins.ubuntu.com/server/job/cloud-init-ci/648/ Executed test runs: SUCCESS: Checkout FAILED: Unit & Style Tests Click here to trigger a rebuild: https://jenkins.ubuntu.com/server/job/cloud-init-ci/648/rebuild -- https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/335470 Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:azure-no-ifupdown 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] ~chad.smith/cloud-init:azure-no-ifupdown into cloud-init:master
One inline comment about a potential alternative that may be more palatable/specific. Diff comments: > diff --git a/cloudinit/sources/DataSourceAzure.py > b/cloudinit/sources/DataSourceAzure.py > index e73b57b..a56ced2 100644 > --- a/cloudinit/sources/DataSourceAzure.py > +++ b/cloudinit/sources/DataSourceAzure.py > @@ -591,6 +591,18 @@ def address_ephemeral_resize(devpath=RESOURCE_DISK_PATH, > maxwait=120, > return > > > +def _is_bounce_command_missing_dependency(command): > +'''Return True if bounce command is unsupported.''' > +if isinstance(command, (list, tuple)): Since the datasource command is configurable by the underlying images, we can't be certain if it's a list, tuple or single string. Need to check potential types for ifdown calls. One, maybe more specific alternative to util.which('ifdown') would be specifically test util.subp(['systemctl', 'is-enabled', 'systemd-networkd']) for 'enabled'. If enabled and 'ifdown' in command, we Skip. > +for item in command: > +if 'ifdown' in item and not util.which('ifdown'): > +return True > +else: > +if 'ifdown' in command and not util.which('ifdown'): > +return True > +return False > + > + > def perform_hostname_bounce(hostname, cfg, prev_hostname): > # set the hostname to 'hostname' if it is not already set to that. > # then, if policy is not off, bounce the interface using command -- https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/335470 Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:azure-no-ifupdown 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] ~chad.smith/cloud-init:azure-no-ifupdown into cloud-init:master
Chad Smith has proposed merging ~chad.smith/cloud-init:azure-no-ifupdown into cloud-init:master. Requested reviews: cloud-init commiters (cloud-init-dev) For more details, see: https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/335470 azure: Don't bounce network with ifdown ifup when those tools don't exist This fixes a traceback when attempting to bounce the network after hostname resets. In artful and bionic ifupdown package is no longer installed in default cloudimages. As such, Azure can't use those tools to bounce the network informing DDNS about hostname changes. This doesn't affect DDNS updates though because systemd-networkd is now watching hostname deltas and with default behavior to SendHostname=True over dhcp for all hostname updates which publishes DDNS for us. This branch also fixes two use-cases unhandled by the prerequisite branch: - In lxc's ip -o link list returns interface alias information such as eth0@if37 which needs to be truncated as we try to complete network device information - In Azure, host target routes and gateways need to be handled LP: #1722668 -- Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:azure-no-ifupdown into cloud-init:master. diff --git a/cloudinit/sources/DataSourceAzure.py b/cloudinit/sources/DataSourceAzure.py index e73b57b..a56ced2 100644 --- a/cloudinit/sources/DataSourceAzure.py +++ b/cloudinit/sources/DataSourceAzure.py @@ -591,6 +591,18 @@ def address_ephemeral_resize(devpath=RESOURCE_DISK_PATH, maxwait=120, return +def _is_bounce_command_missing_dependency(command): +'''Return True if bounce command is unsupported.''' +if isinstance(command, (list, tuple)): +for item in command: +if 'ifdown' in item and not util.which('ifdown'): +return True +else: +if 'ifdown' in command and not util.which('ifdown'): +return True +return False + + def perform_hostname_bounce(hostname, cfg, prev_hostname): # set the hostname to 'hostname' if it is not already set to that. # then, if policy is not off, bounce the interface using command @@ -608,6 +620,10 @@ def perform_hostname_bounce(hostname, cfg, prev_hostname): if command == "builtin": command = BOUNCE_COMMAND +if _is_bounce_command_missing_dependency(command): +LOG.debug( +"Skipping network bounce: ifupdown utils aren't present.") +return LOG.debug("pubhname: publishing hostname [%s]", msg) shell = not isinstance(command, (list, tuple)) # capture=False, see comments in bug 1202758 and bug 1206164. diff --git a/tests/unittests/test_datasource/test_azure.py b/tests/unittests/test_datasource/test_azure.py index 5ab4889..3cfc4d2 100644 --- a/tests/unittests/test_datasource/test_azure.py +++ b/tests/unittests/test_datasource/test_azure.py @@ -174,6 +174,7 @@ scbus-1 on xpt0 bus 0 (dsaz, 'get_hostname', mock.MagicMock()), (dsaz, 'set_hostname', mock.MagicMock()), (dsaz, 'get_metadata_from_fabric', self.get_metadata_from_fabric), +(dsaz.util, 'which', lambda x: True), (dsaz.util, 'read_dmi_data', mock.MagicMock( side_effect=_dmi_mocks)), (dsaz.util, 'wait_for_files', mock.MagicMock( @@ -642,6 +643,8 @@ fdescfs/dev/fd fdescfs rw 0 0 class TestAzureBounce(CiTestCase): +with_logs = True + def mock_out_azure_moving_parts(self): self.patches.enter_context( mock.patch.object(dsaz, 'invoke_agent')) @@ -753,6 +756,22 @@ class TestAzureBounce(CiTestCase): self.assertTrue(ret) self.assertEqual(1, perform_hostname_bounce.call_count) +def test_bounce_skipped_on_ifupdown_absent(self): +host_name = 'unchanged-host-name' +self.get_hostname.return_value = host_name +cfg = {'hostname_bounce': {'policy': 'force'}} +dsrc = self._get_ds(self.get_ovf_env_with_dscfg(host_name, cfg), +agent_command=['not', '__builtin__']) +patch_path = 'cloudinit.sources.DataSourceAzure.util.which' +with mock.patch(patch_path) as m_which: +m_which.return_value = None +ret = self._get_and_setup(dsrc) +self.assertEqual([mock.call('ifdown')], m_which.call_args_list) +self.assertTrue(ret) +self.assertIn( +"Skipping network bounce: ifupdown utils aren't present.", +self.logs.getvalue()) + def test_different_hostnames_sets_hostname(self): expected_hostname = 'azure-expected-host-name' self.get_hostname.return_value = 'default-host-name' @@ -818,8 +837,6 @@ class TestAzureBounce(CiTestCase): self.assertEqual(old_hostname, bounce_env['old_hostname']) def test_default_bounce_command_used_by_default(self): -cmd = 'default-bounce-command' -
Re: [Cloud-init-dev] [Merge] ~powersj/cloud-init:cii-enable-ec2 into cloud-init:master
Review: Approve continuous-integration PASSED: Continuous integration, rev:0b61ef9c2353cdb14f5a9b0ae9c9e2001ca2bf3a https://jenkins.ubuntu.com/server/job/cloud-init-ci/647/ Executed test runs: SUCCESS: Checkout SUCCESS: Unit & Style Tests SUCCESS: Ubuntu LTS: Build SUCCESS: Ubuntu LTS: Integration SUCCESS: MAAS Compatability Testing IN_PROGRESS: Declarative: Post Actions Click here to trigger a rebuild: https://jenkins.ubuntu.com/server/job/cloud-init-ci/647/rebuild -- https://code.launchpad.net/~powersj/cloud-init/+git/cloud-init/+merge/335186 Your team cloud-init commiters is requested to review the proposed merge of ~powersj/cloud-init:cii-enable-ec2 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] ~chad.smith/cloud-init:azure-no-ifupdown into cloud-init:master
Chad Smith has proposed merging ~chad.smith/cloud-init:azure-no-ifupdown into cloud-init:master with ~james-hogarth/cloud-init:net-tools-deprecation as a prerequisite. Commit message: azure: Don't bounce network with ifdown ifup when those tools don't exist This fixes a traceback when attempting to bounce the network after hostname resets. In artful and bionic ifupdown package is no longer installed in default cloudimages. As such, Azure can't use those tools to bounce the network informing DDNS about hostname changes. This doesn't affect DDNS updates though because systemd-networkd is now watching hostname deltas and with default behavior to SendHostname=True over dhcp for all hostname updates which publishes DDNS for us. This branch also fixes two use-cases unhandled by the prerequisite branch: - In lxc's ip -o link list returns interface alias information such as eth0@if37 which needs to be truncated as we try to complete network device information - In Azure, host target routes and gateways need to be handled LP: #1722668 Requested reviews: cloud-init commiters (cloud-init-dev) Server Team CI bot (server-team-bot): continuous-integration For more details, see: https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/335468 azure: Don't bounce network with ifdown or ifup when those tools don't exist This fixes a traceback when attempting to bounce the network after hostname resets. In artful and bionic ifupdown package is no longer installed in cloudimages. As such, Azure can't use those tools to bounce the network informing DDNS about hostname changes. This doesn't appear to affect DDNS updates though because systemd-networkd is already watching hostname and defaults to SendHostname=True during all dhcp upon hostname deltas which posts updates to DDNS for us. This branch also fixes two use-cases unhandled by the prerequisite branch: - In lxc's ip -o link list returns interface alias information such as eth0@if37 which needs to be truncated as we try to complete network device information - In Azure, host target routes and gateways need to be handled LP: #1722668 -- Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:azure-no-ifupdown 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] ~chad.smith/cloud-init:azure-no-ifupdown into cloud-init:master
The proposal to merge ~chad.smith/cloud-init:azure-no-ifupdown into cloud-init:master has been updated. Status: Needs review => Superseded For more details, see: https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/335465 -- Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:azure-no-ifupdown 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] ~powersj/cloud-init:cii-enable-ec2 into cloud-init:master
Review: Approve continuous-integration PASSED: Continuous integration, rev:322b9f9de21d796956684cd07178d2256e8fca2a https://jenkins.ubuntu.com/server/job/cloud-init-ci/646/ Executed test runs: SUCCESS: Checkout SUCCESS: Unit & Style Tests SUCCESS: Ubuntu LTS: Build SUCCESS: Ubuntu LTS: Integration SUCCESS: MAAS Compatability Testing IN_PROGRESS: Declarative: Post Actions Click here to trigger a rebuild: https://jenkins.ubuntu.com/server/job/cloud-init-ci/646/rebuild -- https://code.launchpad.net/~powersj/cloud-init/+git/cloud-init/+merge/335186 Your team cloud-init commiters is requested to review the proposed merge of ~powersj/cloud-init:cii-enable-ec2 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] ~chad.smith/cloud-init:azure-no-ifupdown into cloud-init:master
The proposal to merge ~chad.smith/cloud-init:azure-no-ifupdown into cloud-init:master has been updated. Description changed to: azure: Don't bounce network with ifdown ifup when those tools don't exist This fixes a traceback when attempting to bounce the network after hostname resets. In artful and bionic ifupdown package is no longer installed in cloudimages. As such, Azure can't use those tools to bounce the network informing DDNS about hostname changes. This doesn't appear to affect DDNS updates though because systemd-networkd is already watching hostname and defaults to SendHostname=True during all dhcp upon hostname deltas which posts updates to DDNS for us. This branch also fixes two use-cases unhandled by the prerequisite branch: - In lxc's ip -o link list returns interface alias information such as eth0@if37 which needs to be truncated as we try to complete network device information - In Azure, host target routes and gateways need to be handled LP: #1722668 For more details, see: https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/335465 -- Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:azure-no-ifupdown 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] ~chad.smith/cloud-init:azure-no-ifupdown into cloud-init:master
The proposal to merge ~chad.smith/cloud-init:azure-no-ifupdown into cloud-init:master has been updated. Commit Message changed to: azure: Don't bounce network with ifdown ifup when those tools don't exist This fixes a traceback when attempting to bounce the network after hostname resets. In artful and bionic ifupdown package is no longer installed in default cloudimages. As such, Azure can't use those tools to bounce the network informing DDNS about hostname changes. This doesn't affect DDNS updates though because systemd-networkd is now watching hostname deltas and with default behavior to SendHostname=True over dhcp for all hostname updates which publishes DDNS for us. This branch also fixes two use-cases unhandled by the prerequisite branch: - In lxc's ip -o link list returns interface alias information such as eth0@if37 which needs to be truncated as we try to complete network device information - In Azure, host target routes and gateways need to be handled LP: #1722668 For more details, see: https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/335465 -- Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:azure-no-ifupdown 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] ~chad.smith/cloud-init:azure-no-ifupdown into cloud-init:master
The proposal to merge ~chad.smith/cloud-init:azure-no-ifupdown into cloud-init:master has been updated. Commit Message changed to: azure: Don't bounce network with ifdown ifup when those tools don't exist This fixes a traceback when attempting to bounce the network after hostname resets. In artful and bionic ifupdown package is no longer installed in cloudimages. As such, Azure can't use those tools to bounce the network informing DDNS about hostname changes. This doesn't appear to affect DDNS updates though because systemd-networkd is already watching hostname and defaults to SendHostname=True during all dhcp upon hostname deltas which posts updates to DDNS for us. This branch also fixes two use-cases unhandled by the prerequisite branch: - In lxc's ip -o link list returns interface alias information such as eth0@if37 which needs to be truncated as we try to complete network device information - In Azure, host target routes and gateways need to be handled LP: #1722668 For more details, see: https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/335465 -- Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:azure-no-ifupdown 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] ~chad.smith/cloud-init:azure-no-ifupdown into cloud-init:master
The proposal to merge ~chad.smith/cloud-init:azure-no-ifupdown into cloud-init:master has been updated. Description changed to: azure: Don't bounce network with ifdown ifup when those tools don't exist This fixes a traceback when attempting to bounce the network after hostname resets. In artful and bionic ifupdown package is no longer installed in cloudimages. As such, Azure can't use those tools to bounce the network informing DDNS about hostname changes. This doesn't appear to affect DDNS updates though because systemd-networkd is already watching hostname and defaults to SendHostname=True during all dhcp upon hostname deltas which posts updates to DDNS for us. This branch also fixes two use-cases unhandled by the prerequisite branch: - In lxc's ip -o link list returns interface alias information such as eth0@if37 which needs to be truncated as we try to complete network device information - In Azure, host target routes and gateways need to be handled LP: #1722668 For more details, see: https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/335465 -- Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:azure-no-ifupdown 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] ~powersj/cloud-init:cii-enable-ec2 into cloud-init:master
Joshua Powers has proposed merging ~powersj/cloud-init:cii-enable-ec2 into cloud-init:master. Commit message: tests: Enable AWS EC2 Integration Testing This enables integration tests to utilize AWS EC2 as a testing platform by utilizing the boto3 Python library. Usage will create and delete a custom VPC for every run. All resources will be tagged with the ec2 tag, 'cii', and the date (e.g. cii-20171220-102452). The VPC is setup with both IPv4 and IPv6 capabilities, but will only hand out IPv4 addresses by default. Instances will have complete Internet access and have full ingress and egress access (i.e. no firewall). SSH keys are generated with each run of the integration tests with the key getting uploaded to AWS at the start of tests and deleted on exit. To enable creation when the platform is setup the SSH generation code is moved to be completed by the platform setup and not during image setup. The nocloud-kvm platform was updated with this change. Creating a custom image will utilize the same clean script, boot_clean_script, that the LXD platform uses as well. The custom AMI is generated, used, and de-registered after a test run. The default instance type is set to t2.micro. This is the smallest type that will work for both ebs and instance-store. The default timeout for ec2 was increased to 300 from 120 as many tests hit up against the 2 minute timeout and depending on region load can go over. Documentation for the AWS platform was added with the expected configuration files for the platform to be used. There are some additional whitespace changes included as well. pylint exception was added for paramiko and simplestreams. In the past these were not already flagged due to no __init__.py in the subdirectories of files that used these. boto3 was added to the list of dependencies in the tox ci-test runner. Requested reviews: Server Team CI bot (server-team-bot): continuous-integration cloud-init commiters (cloud-init-dev) For more details, see: https://code.launchpad.net/~powersj/cloud-init/+git/cloud-init/+merge/335186 All Tests on Bionic + Xenial with image version of cloud-init --- ec2: https://paste.ubuntu.com/26173562/ ec2: https://paste.ubuntu.com/26179600/ (bionic only) lxd: https://paste.ubuntu.com/26178523/ nocloud-kvm: busted daily image $ python3 -m tests.cloud_tests run --os-name bionic --os-name xenial --platform ec2 --preserve-data --data-dir results_ec2 --verbose $ python3 -m tests.cloud_tests run --os-name bionic --os-name xenial --platform lxd --preserve-data --data-dir results_lxd --verbose $ python3 -m tests.cloud_tests run --os-name bionic --os-name xenial --platform nocloud-kvm --preserve-data --data-dir results_nocloud_kvm --verbose All Tests on Bionic + Xenial with Bionic deb of cloud-init --- ec2: https://paste.ubuntu.com/26179793/ (bionic only) lxd: https://paste.ubuntu.com/26178405/ nocloud-kvm: https://paste.ubuntu.com/26178282/ $ python3 -m tests.cloud_tests run --os-name bionic --os-name xenial --platform ec2 --preserve-data --data-dir results_ec2 --verbose --deb cloud-init_17.1-60-ga30a3bb5-0ubuntu1_all.deb $ python3 -m tests.cloud_tests run --os-name bionic --os-name xenial --platform lxd --preserve-data --data-dir results_lxd --verbose --deb cloud-init_17.1-60-ga30a3bb5-0ubuntu1_all.deb $ python3 -m tests.cloud_tests run --os-name bionic --os-name xenial --platform nocloud-kvm --preserve-data --data-dir results_nocloud_kvm --verbose --deb cloud-init_17.1-60-ga30a3bb5-0ubuntu1_all.deb -- Your team cloud-init commiters is requested to review the proposed merge of ~powersj/cloud-init:cii-enable-ec2 into cloud-init:master. diff --git a/.pylintrc b/.pylintrc index 3ad3692..05a086d 100644 --- a/.pylintrc +++ b/.pylintrc @@ -46,7 +46,7 @@ reports=no # (useful for modules/projects where namespaces are manipulated during runtime # and thus existing member attributes cannot be deduced by static analysis. It # supports qualified module names, as well as Unix pattern matching. -ignored-modules=six.moves,pkg_resources,httplib,http.client +ignored-modules=six.moves,pkg_resources,httplib,http.client,paramiko,simplestreams # List of class names for which member attributes should not be checked (useful # for classes with dynamically set attributes). This supports the use of diff --git a/doc/rtd/topics/tests.rst b/doc/rtd/topics/tests.rst index d668e3f..bf04bb3 100644 --- a/doc/rtd/topics/tests.rst +++ b/doc/rtd/topics/tests.rst @@ -118,19 +118,19 @@ TreeRun and TreeCollect If working on a cloud-init feature or resolving a bug, it may be useful to run the current copy of cloud-init in the integration testing environment. -The integration testing suite can automatically build a deb based on the +The integration testing suite can automatically build a deb based on the current working tree of cloud-init and run the test suite using this deb. The ``tree_run`` and ``tree_collect`` commands take the same arguments as -the ``run`` and ``collect
[Cloud-init-dev] [Merge] ~chad.smith/cloud-init:azure-no-ifupdown into cloud-init:master
Chad Smith has proposed merging ~chad.smith/cloud-init:azure-no-ifupdown into cloud-init:master with ~james-hogarth/cloud-init:net-tools-deprecation as a prerequisite. Requested reviews: cloud-init commiters (cloud-init-dev) For more details, see: https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/335465 azure: Don't bounce network with ifdown ifup when those tools don't exist This fixes a traceback when attempting to bounce the network after hostname resets. In artful and bionic ifupdown package is no longer installed in cloudimages. As such, Azure can't use those tools to bounce the network informing DDNS about hostname changes. This doesn't appear to affect DDNS updates though because systemd-networkd is already watching hostname and defaults to SendHostname=True during all dhcp upon hostname deltas which posts updates to DDNS for us. LP: #1722668 -- Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:azure-no-ifupdown 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