arista_sanitizer

eos_sanitizer.py

For modifying the configuration extracted from an Arista hardware

appliance’s EOS configuration to make it suitable for use on a cEOS container in a lab environment

Functions

eos_to_ceos(switchConfigIn, sysMacIn)

Module entry-point. Accepts an Arista EOS switch config

count_ether_interfaces(switchConfigIn)

Accept a list of lines representing a switch config and return the number of Ethernet interfaces the corresponding cEOS container will need

applySysMac(switchConfigIn, sysMacIn)

Construct and append the event handler configuration to to apply the system-mac-address of the modeled switch to the cEOS

Module Contents

arista_sanitizer.eos_to_ceos(switchConfigIn, sysMacIn)[source]
Module entry-point. Accepts an Arista EOS switch config

and related paraand returns, returning a cEOS lab-ready version of the configuration

Parameters:
  • switchConfigIn (list) – List of lines of a switch’s configuration

  • sysMacIn (str) – The system MAC address of the original switch

Return type:

list

arista_sanitizer.count_ether_interfaces(switchConfigIn)[source]

Accept a list of lines representing a switch config and return the number of Ethernet interfaces the corresponding cEOS container will need

Parameters:

switchConfigIn (list) – List of lines of a switch’s configuration

Returns:

my_ethercount – The number of Ethernet interfaces the cEOS container version of the switch will need

Return type:

int

arista_sanitizer.applySysMac(switchConfigIn, sysMacIn)[source]

Construct and append the event handler configuration to to apply the system-mac-address of the modeled switch to the cEOS container’s configuration

Parameters:
  • switchConfigIn (list) – List of lines of a switch’s configuration

  • sysMacIn (str) – The system MAC address of the original switch

Returns:

switchConfigIn – List of lines of a switch’s configuration

Return type:

list