Code Review
/
snaps.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Added MTU network config and updated flavor_metadata test support
[snaps.git]
/
snaps
/
config
/
network.py
diff --git
a/snaps/config/network.py
b/snaps/config/network.py
index
85a9fae
..
620640f
100644
(file)
--- a/
snaps/config/network.py
+++ b/
snaps/config/network.py
@@
-46,6
+46,7
@@
class NetworkConfig(object):
:param segmentation_id: the id of the segmentation
(this is required when network_type is 'vlan')
:param subnets or subnet_settings: List of SubnetConfig objects.
:param segmentation_id: the id of the segmentation
(this is required when network_type is 'vlan')
:param subnets or subnet_settings: List of SubnetConfig objects.
+ :param mtu: MTU setting (optional)
:return:
"""
:return:
"""
@@
-88,6
+89,8
@@
class NetworkConfig(object):
if not self.name or len(self.name) < 1:
raise NetworkConfigError('Name required for networks')
if not self.name or len(self.name) < 1:
raise NetworkConfigError('Name required for networks')
+ self.mtu = kwargs.get('mtu')
+
def get_project_id(self, os_creds):
"""
Returns the project ID for a given project_name or None
def get_project_id(self, os_creds):
"""
Returns the project ID for a given project_name or None
@@
-144,6
+147,8
@@
class NetworkConfig(object):
out['provider:segmentation_id'] = self.segmentation_id
if self.external:
out['router:external'] = self.external
out['provider:segmentation_id'] = self.segmentation_id
if self.external:
out['router:external'] = self.external
+ if self.mtu:
+ out['mtu'] = self.mtu
return {'network': out}
return {'network': out}
@@
-458,6
+463,10
@@
class PortConfig(object):
try:
network = neutron_utils.get_network(
neutron, keystone, network_name=self.network_name)
try:
network = neutron_utils.get_network(
neutron, keystone, network_name=self.network_name)
+ if network and not network.shared:
+ network = neutron_utils.get_network(
+ neutron, keystone, network_name=self.network_name,
+ project_name=project_name)
finally:
if session:
keystone_utils.close_session(session)
finally:
if session:
keystone_utils.close_session(session)