Skip to content

Commit

Permalink
Clean up FexInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Smith committed Feb 8, 2017
1 parent 5b8cb93 commit cce7648
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions acitoolkit/acitoolkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -4741,20 +4741,22 @@ def __init__(self, if_type, pod, node, tunnel):
self.if_name += self.node + '/' + self.tunnel


class FexInterface(object):
class FexInterface(BaseACIObject):
"""This class describes a physical interface on a FEX device"""

def __init__(self, if_type, pod, node, fex, module, port):
if_name = str(if_type) + ' ' + str(pod) + '/'
if_name += str(node) + '/' + str(fex) + '/'
if_name += str(module) + '/' + str(port)
super(FexInterface, self).__init__(if_name)
self.interface_type = str(if_type)
self.pod = str(pod)
self.node = str(node)
self.fex = str(fex)
self.module = str(module)
self.port = str(port)
self.if_name = self.interface_type + ' ' + self.pod + '/'
self.if_name += self.node + '/' + self.fex + '/'
self.if_name += self.module + '/' + self.port
self._session = None
self.if_name = if_name
self.attributes = {'if_name': self.if_name}
self.stats = InterfaceStats(self, self.attributes.get('dn'))

Expand All @@ -4777,6 +4779,16 @@ def is_dn_a_fex_interface(cls, dn):
return True
return False

def _get_path(self):
"""Get the path of this interface used when communicating with
the APIC object model.
"""
return 'topology/pod-%s/paths-%s/pathep-[eth%s/%s]' % (self.pod,
self.node,
self.module,
self.port)



def _interface_from_dn(dn):
"""
Expand Down

0 comments on commit cce7648

Please sign in to comment.