/arbitrary_port.py Secret
Created
January 18, 2016 16:29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _make_rescue_port(self, ironic_node, mac_address=None): | |
"""Make and return a dict suitable to create a neutron rescue port. | |
ironic_node -- node dict from ironic api | |
""" | |
port_info = utils.get_port_info(ironic_node) | |
data = { | |
"port": { | |
"commit": True, | |
"switch:hardware_id": ironic_node['uuid'], | |
"switch:ports": [{ | |
"name": "eth0", | |
"port": port_info["port0"], | |
"switch_id": port_info["cab0"] | |
}, | |
{ | |
"name": "eth1", | |
"port": port_info["port1"], | |
"switch_id": port_info["cab1"] | |
}], | |
"network_id": RESCUE_UUID, | |
"tenant_id": "xxx" | |
} | |
} | |
if mac_address: | |
data["port"]["mac_address"] = mac_address | |
return data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment