X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FTap.py;h=4e04a4ab33983f14b6ad62214dc575d6a9a6d932;hp=cf0ae215ede3313bda9b84901b71db4d0a1f38f2;hb=3c863def2096b573832499985e3a12bbccf82ea8;hpb=7bfb36dfd9284bbca10881e31e14108c7d468b7c diff --git a/resources/libraries/python/Tap.py b/resources/libraries/python/Tap.py index cf0ae215ed..4e04a4ab33 100644 --- a/resources/libraries/python/Tap.py +++ b/resources/libraries/python/Tap.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016 Cisco and/or its affiliates. +# Copyright (c) 2018 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -34,7 +34,7 @@ class Tap(object): :returns: Returns a interface index. :rtype: int """ - command = 'connect' + command = 'create' if mac is not None: args = 'tapname {} mac {}'.format(tap_name, mac) else: @@ -67,7 +67,7 @@ class Tap(object): :type if_index: int :type tap_name: str :type mac: str - :return: Returns a interface index. + :returns: Returns a interface index. :rtype: int """ command = 'modify' @@ -120,7 +120,7 @@ class Tap(object): :raises RuntimeError: Specified interface was not found. """ tap_if = InterfaceUtil.tap_dump(node, tap_name) - if len(tap_if) == 0: + if not tap_if: raise RuntimeError( 'Tap interface :{} does not exist'.format(tap_name))