Merge lp:~snaiksat/neutron/sumit-multiblade-consolidated into lp:~cisco-openstack/neutron/l2network-plugin-consolidated

Proposed by Sumit Naiksatam
Status: Merged
Merged at revision: 90
Proposed branch: lp:~snaiksat/neutron/sumit-multiblade-consolidated
Merge into: lp:~cisco-openstack/neutron/l2network-plugin-consolidated
Diff against target: 65 lines (+23/-11)
1 file modified
quantum/plugins/cisco/ucs/cisco_ucs_inventory.py (+23/-11)
To merge this branch: bzr merge lp:~snaiksat/neutron/sumit-multiblade-consolidated
Reviewer Review Type Date Requested Status
Shweta P Approve
Review via email: mp+72355@code.launchpad.net

Description of the change

Fixes an issue with the loading of the UCS inventory when a dynamic nic has been used outside of Quantum.

To post a comment you must log in.
Revision history for this message
Shweta P (shweta-ap05) wrote :

Looks good to me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'quantum/plugins/cisco/ucs/cisco_ucs_inventory.py'
--- quantum/plugins/cisco/ucs/cisco_ucs_inventory.py 2011-08-21 05:10:33 +0000
+++ quantum/plugins/cisco/ucs/cisco_ucs_inventory.py 2011-08-21 19:50:24 +0000
@@ -96,7 +96,7 @@
96 def _load_inventory(self):96 def _load_inventory(self):
97 """Load the inventory from a config file"""97 """Load the inventory from a config file"""
98 inventory = deepcopy(conf.INVENTORY)98 inventory = deepcopy(conf.INVENTORY)
99 LOG.debug("Loaded UCS inventory: %s\n" % inventory)99 LOG.info("Loaded UCS inventory: %s\n" % inventory)
100100
101 for ucsm in inventory.keys():101 for ucsm in inventory.keys():
102 ucsm_ip = inventory[ucsm][const.IP_ADDRESS]102 ucsm_ip = inventory[ucsm][const.IP_ADDRESS]
@@ -130,6 +130,8 @@
130 blade_intf_data = self._client.get_blade_data(chassis_id, blade_id,130 blade_intf_data = self._client.get_blade_data(chassis_id, blade_id,
131 ucsm_ip, ucsm_username,131 ucsm_ip, ucsm_username,
132 ucsm_password)132 ucsm_password)
133 LOG.info("Building UCS inventory state (this may take a while)...")
134
133 unreserved_counter = 0135 unreserved_counter = 0
134136
135 for blade_intf in blade_intf_data.keys():137 for blade_intf in blade_intf_data.keys():
@@ -152,16 +154,23 @@
152 blade_intf_data[blade_intf][const.BLADE_INTF_RESERVATION] = \154 blade_intf_data[blade_intf][const.BLADE_INTF_RESERVATION] = \
153 const.BLADE_INTF_RESERVED155 const.BLADE_INTF_RESERVED
154 port_binding = udb.get_portbinding_dn(dist_name)156 port_binding = udb.get_portbinding_dn(dist_name)
155 blade_intf_data[blade_intf][const.TENANTID] = \157 if not port_binding:
156 port_binding[const.TENANTID]158 blade_intf_data[blade_intf][const.TENANTID] = None
157 blade_intf_data[blade_intf][const.PORTID] = \159 blade_intf_data[blade_intf][const.PORTID] = None
158 port_binding[const.PORTID]160 blade_intf_data[blade_intf][const.PROFILE_ID] = None
159 blade_intf_data[blade_intf][const.PROFILE_ID] = \161 blade_intf_data[blade_intf][const.INSTANCE_ID] = None
160 port_binding[const.PORTPROFILENAME]162 blade_intf_data[blade_intf][const.VIF_ID] = None
161 blade_intf_data[blade_intf][const.INSTANCE_ID] = \163 else:
162 port_binding[const.INSTANCE_ID]164 blade_intf_data[blade_intf][const.TENANTID] = \
163 blade_intf_data[blade_intf][const.VIF_ID] = \165 port_binding[const.TENANTID]
164 port_binding[const.VIF_ID]166 blade_intf_data[blade_intf][const.PORTID] = \
167 port_binding[const.PORTID]
168 blade_intf_data[blade_intf][const.PROFILE_ID] = \
169 port_binding[const.PORTPROFILENAME]
170 blade_intf_data[blade_intf][const.INSTANCE_ID] = \
171 port_binding[const.INSTANCE_ID]
172 blade_intf_data[blade_intf][const.VIF_ID] = \
173 port_binding[const.VIF_ID]
165174
166 blade_data = {const.BLADE_INTF_DATA: blade_intf_data,175 blade_data = {const.BLADE_INTF_DATA: blade_intf_data,
167 const.BLADE_UNRESERVED_INTF_COUNT: unreserved_counter}176 const.BLADE_UNRESERVED_INTF_COUNT: unreserved_counter}
@@ -356,6 +365,9 @@
356 blade_data = ucsm[chassis_id][blade_id]365 blade_data = ucsm[chassis_id][blade_id]
357 blade_intf_data = blade_data[const.BLADE_INTF_DATA]366 blade_intf_data = blade_data[const.BLADE_INTF_DATA]
358 for blade_intf in blade_intf_data.keys():367 for blade_intf in blade_intf_data.keys():
368 if not blade_intf_data[blade_intf][const.PORTID] or \
369 not blade_intf_data[blade_intf][const.TENANTID]:
370 continue
359 if blade_intf_data[blade_intf]\371 if blade_intf_data[blade_intf]\
360 [const.BLADE_INTF_RESERVATION] == \372 [const.BLADE_INTF_RESERVATION] == \
361 const.BLADE_INTF_RESERVED and \373 const.BLADE_INTF_RESERVED and \

Subscribers

People subscribed via source and target branches