PodVIFDriver impl - fix release_vif() signature

Some of the implementations of PodVIFDriver do not have the project_id
and security_groups parameters, resulting in runtime exceptions if these
drivers are used with handlers that expect base class signature to be
followed.

Change-Id: Id1972e02f71238771062cdebec37a3a8a22d768b
Closes-Bug: 1787918
Signed-off-by: Yash Gupta <y.gupta@samsung.com>
This commit is contained in:
Yash Gupta 2018-08-20 16:50:50 +09:00
parent 0f6eea35bc
commit b52f8204a8
4 changed files with 4 additions and 4 deletions

View File

@ -53,7 +53,7 @@ class NestedMacvlanPodVIFDriver(nested_vif.NestedPodVIFDriver):
# TODO(mchiappe): provide an implementation
raise NotImplementedError()
def release_vif(self, pod, vif):
def release_vif(self, pod, vif, project_id=None, security_groups=None):
neutron = clients.get_neutron_client()
container_port = neutron.show_port(vif.id).get('port')

View File

@ -107,7 +107,7 @@ class NestedVlanPodVIFDriver(nested_vif.NestedPodVIFDriver):
vifs.append(vif)
return vifs
def release_vif(self, pod, vif):
def release_vif(self, pod, vif, project_id=None, security_groups=None):
neutron = clients.get_neutron_client()
parent_port = self._get_parent_port(neutron, pod)
trunk_id = self._get_trunk_id(parent_port)

View File

@ -71,7 +71,7 @@ class NeutronPodVIFDriver(base.PodVIFDriver):
vifs.append(vif)
return vifs
def release_vif(self, pod, vif):
def release_vif(self, pod, vif, project_id=None, security_groups=None):
neutron = clients.get_neutron_client()
try:

View File

@ -93,7 +93,7 @@ class NoopVIFPool(base.VIFPoolDriver):
security_groups)
def release_vif(self, pod, vif, *argv):
self._drv_vif.release_vif(pod, vif)
self._drv_vif.release_vif(pod, vif, *argv)
def activate_vif(self, pod, vif):
self._drv_vif.activate_vif(pod, vif)