summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRitesh Madapurath <rmadapur@brocade.com>2016-04-18 01:18:49 -0700
committerRitesh Madapurath <rmadapur@brocade.com>2016-04-18 04:10:15 -0700
commitfe29e27b5eb770f287db9a62ce5dd71981a6bffe (patch)
treed3084392b1cbfa9a81f67253d415e841a7b8ed93
parent23d837998a299291ce35f18b0d3dd779d2052506 (diff)
Bare Metal Support
Enable Baremetal check in mechanism driver for non-ampp Change-Id: I8bcd2a365d601d9699f3e6c989100f15b2e80b57
Notes
Notes (review): Workflow+1: Ritesh Madapurath <rmadapur@brocade.com> Code-Review+2: Ritesh Madapurath <rmadapur@brocade.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Wed, 20 Apr 2016 04:57:11 +0000 Reviewed-on: https://review.openstack.org/306989 Project: openstack/networking-brocade Branch: refs/heads/master
-rw-r--r--networking_brocade/vdx/non_ampp/ml2driver/mechanism_brocade.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/networking_brocade/vdx/non_ampp/ml2driver/mechanism_brocade.py b/networking_brocade/vdx/non_ampp/ml2driver/mechanism_brocade.py
index da4ba56..aaa86b7 100644
--- a/networking_brocade/vdx/non_ampp/ml2driver/mechanism_brocade.py
+++ b/networking_brocade/vdx/non_ampp/ml2driver/mechanism_brocade.py
@@ -144,7 +144,7 @@ class BrocadeMechanism(api.MechanismDriver):
144 _("Brocade Mechanism: create_network_precommit failed")) 144 _("Brocade Mechanism: create_network_precommit failed"))
145 145
146 def create_network_postcommit(self, mech_context): 146 def create_network_postcommit(self, mech_context):
147 """Create Network as a portprofile on the switch.""" 147 """Create Network on the switch."""
148 148
149 LOG.debug("create_network_postcommit: called") 149 LOG.debug("create_network_postcommit: called")
150 150
@@ -199,7 +199,7 @@ class BrocadeMechanism(api.MechanismDriver):
199 _("Brocade Mechanism: delete_network_precommit failed")) 199 _("Brocade Mechanism: delete_network_precommit failed"))
200 200
201 def delete_network_postcommit(self, mech_context): 201 def delete_network_postcommit(self, mech_context):
202 """Delete network which translates to removng portprofile 202 """Delete network
203 from the switch. 203 from the switch.
204 """ 204 """
205 LOG.debug("delete_network_postcommit: called") 205 LOG.debug("delete_network_postcommit: called")
@@ -241,7 +241,7 @@ class BrocadeMechanism(api.MechanismDriver):
241 context, port, mech_context.top_bound_segment) 241 context, port, mech_context.top_bound_segment)
242 242
243 def create_port_postcommit(self, mech_context): 243 def create_port_postcommit(self, mech_context):
244 """Associate the assigned MAC address to the portprofile.""" 244 """Associate the port to the network."""
245 LOG.debug("create_port_postcommit(self: called") 245 LOG.debug("create_port_postcommit(self: called")
246 if self.is_flat_network(mech_context.network.network_segments[0]): 246 if self.is_flat_network(mech_context.network.network_segments[0]):
247 return 247 return
@@ -267,7 +267,7 @@ class BrocadeMechanism(api.MechanismDriver):
267 self._delete_brocade_port(context, port) 267 self._delete_brocade_port(context, port)
268 268
269 def delete_port_postcommit(self, mech_context): 269 def delete_port_postcommit(self, mech_context):
270 """Dissociate MAC address from the portprofile.""" 270 """Dissociate port from the network."""
271 LOG.debug("delete_port_postcommit(self: called") 271 LOG.debug("delete_port_postcommit(self: called")
272 if self.is_flat_network(mech_context.network.network_segments[0]): 272 if self.is_flat_network(mech_context.network.network_segments[0]):
273 return 273 return
@@ -370,9 +370,11 @@ class BrocadeMechanism(api.MechanismDriver):
370 ("dhcp" not in port['device_owner'])): 370 ("dhcp" not in port['device_owner'])):
371 # Not a compute port or dhcp , return 371 # Not a compute port or dhcp , return
372 return False 372 return False
373 #if not self._is_profile_bound_to_port(port, context): 373 if not baremetal_util.is_baremetal_deploy(port):
374 return True
375 if not self._is_profile_bound_to_port(port, context):
374 # it is baremetal port 376 # it is baremetal port
375 # return False 377 return False
376 return True 378 return True
377 379
378 def _is_profile_bound_to_port(self, port, context): 380 def _is_profile_bound_to_port(self, port, context):