Re: [Cloud-init-dev] [Merge] ~daniel-thewatkins/cloud-init/+git/cloud-init:macvtap into cloud-init:master

2019-02-21 Thread Server Team CI bot
Review: Approve continuous-integration

PASSED: Continuous integration, rev:8527e3d86c150997407722aeccaaf894e9ada42b
https://jenkins.ubuntu.com/server/job/cloud-init-ci/579/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
IN_PROGRESS: Declarative: Post Actions

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

-- 
https://code.launchpad.net/~daniel-thewatkins/cloud-init/+git/cloud-init/+merge/363421
Your team cloud-init commiters is requested to review the proposed merge of 
~daniel-thewatkins/cloud-init/+git/cloud-init:macvtap 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] ~daniel-thewatkins/cloud-init/+git/cloud-init:macvtap into cloud-init:master

2019-02-21 Thread Dan Watkins
Dan Watkins has proposed merging 
~daniel-thewatkins/cloud-init/+git/cloud-init:macvtap into cloud-init:master.

Commit message:
helpers/openstack: Treat unknown link types as physical

Some deployments of OpenStack expose link types to the guest which
cloud-init doesn't recognise. These will almost always be physical, so
we can operate more robustly if we assume that they are (whilst warning
the user that we're seeing something unexpected).

LP: #1639263

Requested reviews:
  Server Team CI bot (server-team-bot): continuous-integration
  cloud-init commiters (cloud-init-dev)
Related bugs:
  Bug #1639263 in cloud-init: " cloud-init Unknown network_data link type: 
macvtap"
  https://bugs.launchpad.net/cloud-init/+bug/1639263

For more details, see:
https://code.launchpad.net/~daniel-thewatkins/cloud-init/+git/cloud-init/+merge/363421
-- 
Your team cloud-init commiters is requested to review the proposed merge of 
~daniel-thewatkins/cloud-init/+git/cloud-init:macvtap into cloud-init:master.
diff --git a/cloudinit/sources/helpers/openstack.py b/cloudinit/sources/helpers/openstack.py
index 9c29cea..8f06911 100644
--- a/cloudinit/sources/helpers/openstack.py
+++ b/cloudinit/sources/helpers/openstack.py
@@ -67,7 +67,7 @@ OS_VERSIONS = (
 OS_ROCKY,
 )
 
-PHYSICAL_TYPES = (
+KNOWN_PHYSICAL_TYPES = (
 None,
 'bgpovs',  # not present in OpenStack upstream but used on OVH cloud.
 'bridge',
@@ -600,9 +600,7 @@ def convert_net_json(network_json=None, known_macs=None):
 subnet['ipv6'] = True
 subnets.append(subnet)
 cfg.update({'subnets': subnets})
-if link['type'] in PHYSICAL_TYPES:
-cfg.update({'type': 'physical', 'mac_address': link_mac_addr})
-elif link['type'] in ['bond']:
+if link['type'] in ['bond']:
 params = {}
 if link_mac_addr:
 params['mac_address'] = link_mac_addr
@@ -641,8 +639,10 @@ def convert_net_json(network_json=None, known_macs=None):
 curinfo.update({'mac': link['vlan_mac_address'],
 'name': name})
 else:
-raise ValueError(
-'Unknown network_data link type: %s' % link['type'])
+if link['type'] not in KNOWN_PHYSICAL_TYPES:
+LOG.warning('Unknown network_data link type (%s); treating as'
+' physical', link['type'])
+cfg.update({'type': 'physical', 'mac_address': link_mac_addr})
 
 config.append(cfg)
 link_id_info[curinfo['id']] = curinfo
diff --git a/tests/unittests/test_datasource/test_configdrive.py b/tests/unittests/test_datasource/test_configdrive.py
index dcdabea..664f354 100644
--- a/tests/unittests/test_datasource/test_configdrive.py
+++ b/tests/unittests/test_datasource/test_configdrive.py
@@ -604,6 +604,9 @@ class TestNetJson(CiTestCase):
 
 
 class TestConvertNetworkData(CiTestCase):
+
+with_logs = True
+
 def setUp(self):
 super(TestConvertNetworkData, self).setUp()
 self.tmp = self.tmp_dir()
@@ -730,6 +733,26 @@ class TestConvertNetworkData(CiTestCase):
 'enp0s2': 'fa:16:3e:d4:57:ad'}
 self.assertEqual(expected, config_name2mac)
 
+def test_unknown_device_types_accepted(self):
+# If we don't recognise a link, we should treat it as physical for a
+# best-effort boot
+my_netdata = deepcopy(NETWORK_DATA)
+my_netdata['links'][0]['type'] = 'my-special-link-type'
+
+ncfg = openstack.convert_net_json(my_netdata, known_macs=KNOWN_MACS)
+config_name2mac = {}
+for n in ncfg['config']:
+if n['type'] == 'physical':
+config_name2mac[n['name']] = n['mac_address']
+
+expected = {'nic0': 'fa:16:3e:05:30:fe', 'enp0s1': 'fa:16:3e:69:b0:58',
+'enp0s2': 'fa:16:3e:d4:57:ad'}
+self.assertEqual(expected, config_name2mac)
+
+# We should, however, warn the user that we don't recognise the type
+self.assertIn('Unknown network_data link type (my-special-link-type)',
+  self.logs.getvalue())
+
 
 def cfg_ds_from_dir(base_d, files=None):
 run = os.path.join(base_d, "run")
___
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] ~daniel-thewatkins/cloud-init/+git/cloud-init:macvtap into cloud-init:master

2019-02-21 Thread Ryan Harper
This looks good.

You can see the existing openstack network_data.json samples in:

tests/unittests/test_net.py line 426 of 4185  OS_SAMPLES

That shows the general structure.  Another one is in

tests/unittests/test_datasource/test_configdrive.py
-- 
https://code.launchpad.net/~daniel-thewatkins/cloud-init/+git/cloud-init/+merge/363421
Your team cloud-init commiters is requested to review the proposed merge of 
~daniel-thewatkins/cloud-init/+git/cloud-init:macvtap 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] ~daniel-thewatkins/cloud-init/+git/cloud-init:macvtap into cloud-init:master

2019-02-21 Thread Dan Watkins
The proposal to merge ~daniel-thewatkins/cloud-init/+git/cloud-init:macvtap 
into cloud-init:master has been updated.

Status: Needs review => Work in progress

For more details, see:
https://code.launchpad.net/~daniel-thewatkins/cloud-init/+git/cloud-init/+merge/363421
-- 
Your team cloud-init commiters is requested to review the proposed merge of 
~daniel-thewatkins/cloud-init/+git/cloud-init:macvtap 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] ~daniel-thewatkins/cloud-init/+git/cloud-init:macvtap into cloud-init:master

2019-02-20 Thread Ryan Harper
If we're going to touch this, maybe we could get a wider list from whatever 
openstack has  there now?

https://github.com/openstack/nova/blob/c6218428e9b29a2c52808ec7d27b4b21aadc0299/nova/network/model.py


-- 
https://code.launchpad.net/~daniel-thewatkins/cloud-init/+git/cloud-init/+merge/363421
Your team cloud-init commiters is requested to review the proposed merge of 
~daniel-thewatkins/cloud-init/+git/cloud-init:macvtap 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] ~daniel-thewatkins/cloud-init/+git/cloud-init:macvtap into cloud-init:master

2019-02-20 Thread Server Team CI bot
Review: Approve continuous-integration

PASSED: Continuous integration, rev:5b041496005975cbaf63c1c996814901bb0d6894
https://jenkins.ubuntu.com/server/job/cloud-init-ci/568/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
IN_PROGRESS: Declarative: Post Actions

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

-- 
https://code.launchpad.net/~daniel-thewatkins/cloud-init/+git/cloud-init/+merge/363421
Your team cloud-init commiters is requested to review the proposed merge of 
~daniel-thewatkins/cloud-init/+git/cloud-init:macvtap 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] ~daniel-thewatkins/cloud-init/+git/cloud-init:macvtap into cloud-init:master

2019-02-20 Thread Server Team CI bot
Review: Approve continuous-integration

PASSED: Continuous integration, rev:e356bb117e48f6497d4e747c131c738c5d4a41ec
https://jenkins.ubuntu.com/server/job/cloud-init-ci/567/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
IN_PROGRESS: Declarative: Post Actions

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

-- 
https://code.launchpad.net/~daniel-thewatkins/cloud-init/+git/cloud-init/+merge/363421
Your team cloud-init commiters is requested to review the proposed merge of 
~daniel-thewatkins/cloud-init/+git/cloud-init:macvtap 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] ~daniel-thewatkins/cloud-init/+git/cloud-init:macvtap into cloud-init:master

2019-02-20 Thread Dan Watkins
The proposal to merge ~daniel-thewatkins/cloud-init/+git/cloud-init:macvtap 
into cloud-init:master has been updated.

Commit message changed to:

helpers/openstack: Add macvlan to link types

This enables the use of macvlan interfaces within older versions of
OpenStack.

LP: #1639263

For more details, see:
https://code.launchpad.net/~daniel-thewatkins/cloud-init/+git/cloud-init/+merge/363421
-- 
Your team cloud-init commiters is requested to review the proposed merge of 
~daniel-thewatkins/cloud-init/+git/cloud-init:macvtap 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] ~daniel-thewatkins/cloud-init/+git/cloud-init:macvtap into cloud-init:master

2019-02-20 Thread Server Team CI bot
Review: Needs Fixing continuous-integration

FAILED: Continuous integration, rev:e356bb117e48f6497d4e747c131c738c5d4a41ec
No commit message was specified in the merge proposal. Click on the following 
link and set the commit message (if you want a jenkins rebuild you need to 
trigger it yourself):
https://code.launchpad.net/~daniel-thewatkins/cloud-init/+git/cloud-init/+merge/363421/+edit-commit-message

https://jenkins.ubuntu.com/server/job/cloud-init-ci/566/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
IN_PROGRESS: Declarative: Post Actions

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

-- 
https://code.launchpad.net/~daniel-thewatkins/cloud-init/+git/cloud-init/+merge/363421
Your team cloud-init commiters is requested to review the proposed merge of 
~daniel-thewatkins/cloud-init/+git/cloud-init:macvtap 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] ~daniel-thewatkins/cloud-init/+git/cloud-init:macvtap into cloud-init:master

2019-02-20 Thread Dan Watkins
Dan Watkins has proposed merging 
~daniel-thewatkins/cloud-init/+git/cloud-init:macvtap into cloud-init:master.

Requested reviews:
  cloud-init commiters (cloud-init-dev)
Related bugs:
  Bug #1639263 in cloud-init: " cloud-init Unknown network_data link type: 
macvtap"
  https://bugs.launchpad.net/cloud-init/+bug/1639263

For more details, see:
https://code.launchpad.net/~daniel-thewatkins/cloud-init/+git/cloud-init/+merge/363421
-- 
Your team cloud-init commiters is requested to review the proposed merge of 
~daniel-thewatkins/cloud-init/+git/cloud-init:macvtap into cloud-init:master.
diff --git a/cloudinit/sources/helpers/openstack.py b/cloudinit/sources/helpers/openstack.py
index 9c29cea..de95c28 100644
--- a/cloudinit/sources/helpers/openstack.py
+++ b/cloudinit/sources/helpers/openstack.py
@@ -75,6 +75,7 @@ PHYSICAL_TYPES = (
 'ethernet',
 'hw_veb',
 'hyperv',
+'macvlan',
 'ovs',
 'phy',
 'tap',
___
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