-# 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:
:returns: Returns a interface index.
:rtype: int
"""
- command = 'connect'
+ command = 'create'
if mac is not None:
args = 'tapname {} mac {}'.format(tap_name, mac)
else:
: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'
: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))