Skip to content

Commit

Permalink
Merge "Vm project UUID should be optional for Port Add requests." int…
Browse files Browse the repository at this point in the history
…o R3.0
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Feb 22, 2017
2 parents 456f800 + bddcd93 commit 9c9b09e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
7 changes: 1 addition & 6 deletions src/vnsw/agent/port_ipc/port_ipc_handler.cc
Expand Up @@ -190,7 +190,7 @@ bool PortIpcHandler::AddPort(const PortIpcHandler::AddPortParams &r,
if (r.vn_id.length() != 0) {
vn_uuid = StringToUuid(r.vn_id);
}
/* VM Project UUID is optional for CfgIntNameSpacePort */
/* VM Project UUID is optional */
uuid vm_project_uuid = nil_uuid();
if (r.vm_project_id.length() != 0) {
vm_project_uuid = StringToUuid(r.vm_project_id);
Expand Down Expand Up @@ -226,11 +226,6 @@ bool PortIpcHandler::AddPort(const PortIpcHandler::AddPortParams &r,
resp_str += "invalid VN uuid, ";
err = true;
}
if ((intf_type == CfgIntEntry::CfgIntVMPort) &&
(vm_project_uuid == nil_uuid())) {
resp_str += "invalid VM project uuid, ";
err = true;
}
if (!ValidateMac(r.mac_address)) {
resp_str += "Invalid MAC, Use xx:xx:xx:xx:xx:xx format";
err = true;
Expand Down
Expand Up @@ -52,16 +52,15 @@ def add_port(self, vm_uuid_str, vif_uuid_str, interface_name, mac_address,

if 'vm_project_id' in kwargs:
vm_project_id = kwargs['vm_project_id']
if ('port_type' in kwargs and
kwargs['port_type'] in [0,1]):
if ('port_type' in kwargs):
if (kwargs['port_type'] == 0):
port_type = "NovaVMPort"
elif (kwargs['port_type'] == 1):
port_type = "NameSpacePort"
elif (kwargs['port_type'] == 'NameSpacePort'):
port_type = "NameSpacePort"
else:
elif (kwargs['port_type'] == 'NovaVMPort'):
port_type = "NovaVMPort"
else:
port_type = "NameSpacePort"
else:
port_type = "NameSpacePort"

Expand Down

0 comments on commit 9c9b09e

Please sign in to comment.