summaryrefslogtreecommitdiffstats
path: root/testcases/functest_utils.py
diff options
context:
space:
mode:
authorJose Lausuch <jose.lausuch@ericsson.com>2015-12-29 17:04:32 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2015-12-29 17:04:32 +0000
commit4f7e44541bd8c1d20d547891170e48e521f5db3c (patch)
tree89cfb4304ca2945caff76c06c39c1a8dd70ea230 /testcases/functest_utils.py
parent7e19ef72f9d5740b04988679f568dd883881e96c (diff)
parent675652f37c57fe61900d2ac5735b0be9b6269252 (diff)
Merge "Support for removing hanging ports"
Diffstat (limited to 'testcases/functest_utils.py')
-rw-r--r--testcases/functest_utils.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/testcases/functest_utils.py b/testcases/functest_utils.py
index 875060835..00a7b3054 100644
--- a/testcases/functest_utils.py
+++ b/testcases/functest_utils.py
@@ -235,6 +235,19 @@ def create_neutron_port(neutron_client, name, network_id, ip):
return False
+def update_neutron_port(neutron_client, port_id, device_owner):
+ json_body = {'port': {
+ 'device_owner': device_owner,
+ }}
+ try:
+ port = neutron_client.update_port(port=port_id,
+ body=json_body)
+ return port['port']['id']
+ except:
+ print "Error:", sys.exc_info()[0]
+ return False
+
+
def delete_neutron_port(neutron_client, port_id):
try:
neutron_client.delete_port(port_id)