X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FRO.git;a=blobdiff_plain;f=test%2Ftest_osconnector.py;h=92d5437602c8e572d80da49229e01d26e3b915f1;hp=152155bb27d66620437d82b62719338063e76624;hb=64e49f9abd3913c10271c0977d4471e7f18079d6;hpb=c78233e1750d5d231e99ffedb5ba81014f84e6fe diff --git a/test/test_osconnector.py b/test/test_osconnector.py index 152155bb..92d54376 100755 --- a/test/test_osconnector.py +++ b/test/test_osconnector.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- ## -# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. +# Copyright 2015 Telefonica Investigacion y Desarrollo, S.A.U. # This file is part of openmano # All Rights Reserved. # @@ -87,7 +87,7 @@ def delete_items(): try: myvim[name]=id_ result=1 - except Exception, e: + except Exception as e: result=-1 message= " " + str(type(e))[6:-1] + ": "+ str(e) else: @@ -108,7 +108,7 @@ if __name__=="__main__": try: opts, args = getopt.getopt(sys.argv[1:], "hv:u:U:p:t:i:", ["username=", "help", "version=", "password=", "tenant=", "url=","skip-admin-tests",'image=']) - except getopt.GetoptError, err: + except getopt.GetoptError as err: # print help information and exit: print "Error:", err # will print something like "option -a not recognized" usage() @@ -158,7 +158,7 @@ if __name__=="__main__": user=creds['username'], passwd=creds['password'], debug = False, config={'network_vlan_ranges':'physnet_sriov'} ) print " Ok" - except Exception, e: + except Exception as e: print " Fail" print str(type(e))[6:-1] + ": "+ str(e) exit(-1) @@ -229,7 +229,7 @@ if __name__=="__main__": rollback_list.append(("creds", "tenant", creds["tenant_name"])) rollback_list.append(("creds", "user", creds["username"])) rollback_list.append(("creds", "passwd", creds["password"])) - except Exception, e: + except Exception as e: print " Fail" print " Error setting osconnector to new tenant:", str(type(e))[6:-1] + ": "+ str(e) exit(-1)