DBBC3Util Module

This module is part of the DBBC3 package and provides utility methods

checkRecorderInterface(host, device, user='oper')

Returns the state of the given ethernet device on the given host

Parameters:
  • host (str) – the hostname or IP addres of the host to probe

  • device (str) – the name of the network device to check

  • user (str, optional) – the ssh user name to use to carry out the check

Returns:

the state of the given device as provided by the ip link show command

Return type:

str

parseTimeResponse(response)

Parses response of the core3h timesync command (VDIF time) and converts it into datetime (UTC)

Parameters:

response (str) – the reposnse string as provided by the core3h_timesync command

Returns:

the datetime representation of the returned timesync reponse; None in case of failure

Return type:

datetime

parseTimeResponseLegacy(response)

Parses response of the core3h timesync command (VDIF time) and converts it into datetime (UTC)

Parameters:

response (str) – the reposnse string as provided by the core3h_timesync command

Returns:

the datetime representation of the returned timesync reponse

Return type:

datetime

validateOnOff(string)

Validates the argument to be “on” or “off”

Parameters:

string (str) – the input string to check

Returns:

True if input string is either “on” or “off”. False otherwise

Return type:

boolean

vdiftimeToUTC(epoch, seconds)