Browse Source

Bare Metal Support

Enable Baremetal check in mechanism driver for non-ampp

Change-Id: I8bcd2a365d601d9699f3e6c989100f15b2e80b57
Ritesh Madapurath 3 years ago
parent
commit
fe29e27b5e
1 changed files with 8 additions and 6 deletions
  1. 8
    6
      networking_brocade/vdx/non_ampp/ml2driver/mechanism_brocade.py

+ 8
- 6
networking_brocade/vdx/non_ampp/ml2driver/mechanism_brocade.py View File

@@ -144,7 +144,7 @@ class BrocadeMechanism(api.MechanismDriver):
144 144
                 _("Brocade Mechanism: create_network_precommit failed"))
145 145
 
146 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 149
         LOG.debug("create_network_postcommit: called")
150 150
 
@@ -199,7 +199,7 @@ class BrocadeMechanism(api.MechanismDriver):
199 199
                 _("Brocade Mechanism: delete_network_precommit failed"))
200 200
 
201 201
     def delete_network_postcommit(self, mech_context):
202
-        """Delete network which translates to removng portprofile
202
+        """Delete network
203 203
         from the switch.
204 204
         """
205 205
         LOG.debug("delete_network_postcommit: called")
@@ -241,7 +241,7 @@ class BrocadeMechanism(api.MechanismDriver):
241 241
             context, port, mech_context.top_bound_segment)
242 242
 
243 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 245
         LOG.debug("create_port_postcommit(self: called")
246 246
         if self.is_flat_network(mech_context.network.network_segments[0]):
247 247
             return
@@ -267,7 +267,7 @@ class BrocadeMechanism(api.MechanismDriver):
267 267
         self._delete_brocade_port(context, port)
268 268
 
269 269
     def delete_port_postcommit(self, mech_context):
270
-        """Dissociate MAC address from the portprofile."""
270
+        """Dissociate port from the network."""
271 271
         LOG.debug("delete_port_postcommit(self: called")
272 272
         if self.is_flat_network(mech_context.network.network_segments[0]):
273 273
             return
@@ -370,9 +370,11 @@ class BrocadeMechanism(api.MechanismDriver):
370 370
                 ("dhcp" not in port['device_owner'])):
371 371
             # Not a compute port or dhcp , return
372 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 376
             # it is baremetal port
375
-        #    return False
377
+            return False
376 378
         return True
377 379
 
378 380
     def _is_profile_bound_to_port(self, port, context):

Loading…
Cancel
Save