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