VAT-to-PAPI: VPPCounters
[csit.git] / resources / libraries / python / Tap.py
index cf0ae21..4e04a4a 100644 (file)
@@ -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))