summaryrefslogtreecommitdiff
path: root/ironic/api/controllers/v1/utils.py
diff options
context:
space:
mode:
authorHarald Jensås <hjensas@redhat.com>2020-03-26 21:28:13 +0100
committerHarald Jensås <hjensas@redhat.com>2020-04-02 15:39:41 +0200
commitc40d221fca0d8ea6167643068c436e4c1194db91 (patch)
treee8151978e6ff1ad2ce3742fb073dc523ff80a786 /ironic/api/controllers/v1/utils.py
parent6798715eaffc8cb0b25f1775d8192272ba88b786 (diff)
downloadironic-c40d221fca0d8ea6167643068c436e4c1194db91.tar.gz
Add network_type to port local_link_connection
Add network_type to the port objects local_link_connection field. The network_type can be set to either managed or unmanaged. When the type is unmanaged other fields are not required. Use unmanaged when the neutron network_interface is required, but the network is in fact a flat network where no actual switch management is done. Story: 2007315 Task: 39161 Change-Id: I00c5ea22a8163c27c9ce4470e3713c282d0eb131
Diffstat (limited to 'ironic/api/controllers/v1/utils.py')
-rw-r--r--ironic/api/controllers/v1/utils.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/ironic/api/controllers/v1/utils.py b/ironic/api/controllers/v1/utils.py
index 9442209ba..b840845c4 100644
--- a/ironic/api/controllers/v1/utils.py
+++ b/ironic/api/controllers/v1/utils.py
@@ -1369,3 +1369,9 @@ def allow_allocation_owner():
def allow_agent_token():
"""Check if agent token is available."""
return api.request.version.minor >= versions.MINOR_62_AGENT_TOKEN
+
+
+def allow_local_link_connection_network_type():
+ """Check if network_type is allowed in ports link_local_connection"""
+ return (api.request.version.minor
+ >= versions.MINOR_64_LOCAL_LINK_CONNECTION_NETWORK_TYPE)