Open vSwitch ovs-vsctl - utility for querying ovs-vswitchd

Classes in this module are:

OVSvsctlList - command /usr/bin/ovs-vsctl list TBL [REC]

Parsers in this module are:

OVSvsctlListBridge - command /usr/bin/ovs-vsctl list bridge

class insights.parsers.ovs_vsctl.OVSvsctlList(context, extra_bad_lines=None)[source]

Bases: CommandParser, list

Class to parse output of command ovs-vsctl list TBL [REC]. Generally, the data is in key:value format with values having data types as string, numbers, list or dictionary.

Raises:

SkipComponent -- When file is empty.

property data

Set data as property to keep compatibility

parse_content(content)[source]

Details of the subset of the Open vSwitch database, which holds the configuration for the Open vSwitch daemon, are extracted and stored in a list as a dictionary.

class insights.parsers.ovs_vsctl.OVSvsctlListBridge(context, extra_bad_lines=None)[source]

Bases: OVSvsctlList

Class to parse output of command ovs-vsctl list bridge.

Sample command output:

name                : br-int
other_config        : {disable-in-band="true", mac-table-size="2048"}
name                : br-tun
other_config        : {}

Examples

>>> bridge_lists[0]["name"]
'br-int'
>>> bridge_lists[0]["other_config"]["mac-table-size"]
'2048'
>>> bridge_lists[0]["other_config"]["disable-in-band"]
'true'
>>> bridge_lists[1].get("name")
'br-tun'
>>> len(bridge_lists[1]["other_config"]) == 0
True