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
1=== modified file 'quantum/plugins/cisco/ucs/cisco_ucs_inventory.py'
2--- quantum/plugins/cisco/ucs/cisco_ucs_inventory.py 2011-08-21 05:10:33 +0000
3+++ quantum/plugins/cisco/ucs/cisco_ucs_inventory.py 2011-08-21 19:50:24 +0000
4@@ -96,7 +96,7 @@
5 def _load_inventory(self):
6 """Load the inventory from a config file"""
7 inventory = deepcopy(conf.INVENTORY)
8- LOG.debug("Loaded UCS inventory: %s\n" % inventory)
9+ LOG.info("Loaded UCS inventory: %s\n" % inventory)
10
11 for ucsm in inventory.keys():
12 ucsm_ip = inventory[ucsm][const.IP_ADDRESS]
13@@ -130,6 +130,8 @@
14 blade_intf_data = self._client.get_blade_data(chassis_id, blade_id,
15 ucsm_ip, ucsm_username,
16 ucsm_password)
17+ LOG.info("Building UCS inventory state (this may take a while)...")
18+
19 unreserved_counter = 0
20
21 for blade_intf in blade_intf_data.keys():
22@@ -152,16 +154,23 @@
23 blade_intf_data[blade_intf][const.BLADE_INTF_RESERVATION] = \
24 const.BLADE_INTF_RESERVED
25 port_binding = udb.get_portbinding_dn(dist_name)
26- blade_intf_data[blade_intf][const.TENANTID] = \
27- port_binding[const.TENANTID]
28- blade_intf_data[blade_intf][const.PORTID] = \
29- port_binding[const.PORTID]
30- blade_intf_data[blade_intf][const.PROFILE_ID] = \
31- port_binding[const.PORTPROFILENAME]
32- blade_intf_data[blade_intf][const.INSTANCE_ID] = \
33- port_binding[const.INSTANCE_ID]
34- blade_intf_data[blade_intf][const.VIF_ID] = \
35- port_binding[const.VIF_ID]
36+ if not port_binding:
37+ blade_intf_data[blade_intf][const.TENANTID] = None
38+ blade_intf_data[blade_intf][const.PORTID] = None
39+ blade_intf_data[blade_intf][const.PROFILE_ID] = None
40+ blade_intf_data[blade_intf][const.INSTANCE_ID] = None
41+ blade_intf_data[blade_intf][const.VIF_ID] = None
42+ else:
43+ blade_intf_data[blade_intf][const.TENANTID] = \
44+ port_binding[const.TENANTID]
45+ blade_intf_data[blade_intf][const.PORTID] = \
46+ port_binding[const.PORTID]
47+ blade_intf_data[blade_intf][const.PROFILE_ID] = \
48+ port_binding[const.PORTPROFILENAME]
49+ blade_intf_data[blade_intf][const.INSTANCE_ID] = \
50+ port_binding[const.INSTANCE_ID]
51+ blade_intf_data[blade_intf][const.VIF_ID] = \
52+ port_binding[const.VIF_ID]
53
54 blade_data = {const.BLADE_INTF_DATA: blade_intf_data,
55 const.BLADE_UNRESERVED_INTF_COUNT: unreserved_counter}
56@@ -356,6 +365,9 @@
57 blade_data = ucsm[chassis_id][blade_id]
58 blade_intf_data = blade_data[const.BLADE_INTF_DATA]
59 for blade_intf in blade_intf_data.keys():
60+ if not blade_intf_data[blade_intf][const.PORTID] or \
61+ not blade_intf_data[blade_intf][const.TENANTID]:
62+ continue
63 if blade_intf_data[blade_intf]\
64 [const.BLADE_INTF_RESERVATION] == \
65 const.BLADE_INTF_RESERVED and \

Subscribers

People subscribed via source and target branches