aboutsummaryrefslogtreecommitdiffstats
path: root/testcases/functest_utils.py
diff options
context:
space:
mode:
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 87506083..00a7b305 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)