X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FTap.py;h=6b8ae87c047a5324b425f949c0950da81475b22e;hp=cf0ae215ede3313bda9b84901b71db4d0a1f38f2;hb=cc0c2870a18fb74a56410eca2d1870bddc945397;hpb=7bfb36dfd9284bbca10881e31e14108c7d468b7c diff --git a/resources/libraries/python/Tap.py b/resources/libraries/python/Tap.py index cf0ae215ed..6b8ae87c04 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: @@ -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))