Permalink
Browse files

Merge "correct nvplib to update device_id"

  • Loading branch information...
2 parents 15604ab + d6aa31b commit 12ed618200cd265df24a6c0512e59c9e426a3c33 Jenkins committed with openstack-gerrit Oct 12, 2012
@@ -813,6 +813,8 @@ def update_port(self, context, id, port):
params["cluster"] = cluster
params["port"] = port["port"]
+ params["port"]["id"] = quantum_db["id"]
+ params["port"]["tenant_id"] = quantum_db["tenant_id"]
result = nvplib.update_port(quantum_db["network_id"],
port_nvp["uuid"], **params)
LOG.debug("update_port() completed for tenant: %s" % context.tenant_id)
@@ -373,11 +373,20 @@ def update_port(network, port_id, **params):
admin_state_up = params['port'].get('admin_state_up')
name = params["port"].get("name")
+ device_id = params["port"].get("device_id")
if admin_state_up:
lport_obj["admin_status_enabled"] = admin_state_up
if name:
lport_obj["display_name"] = name
+ if device_id:
+ # device_id can be longer than 40 so we rehash it
+ device_id = hashlib.sha1(device_id).hexdigest()
+ lport_obj["tags"] = (
+ [dict(scope='os_tid', tag=params["port"].get("tenant_id")),
+ dict(scope='q_port_id', tag=params["port"]["id"]),
+ dict(scope='vm_id', tag=device_id)])
+
uri = "/ws.v1/lswitch/" + network + "/lport/" + port_id
try:
resp_obj = do_single_request("PUT", uri, json.dumps(lport_obj),
@@ -394,8 +403,6 @@ def update_port(network, port_id, **params):
def create_port(tenant, **params):
- print "create_port_nvplib"
- print params
clusters = params["clusters"]
dest_cluster = clusters[0] # primary cluster

0 comments on commit 12ed618

Please sign in to comment.