MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / _configure_lldpd

Function _configure_lldpd

network_diagnostics.py:1853–1867  ·  view source on GitHub ↗

Enable CDPv1/v2/EDP/FDP/SONMP decoding and (re)start lldpd -- mirrors the Ragnar installer/updater so on-demand installs also see non-LLDP switches.

()

Source from the content-addressed store, hash-verified

1851
1852
1853def _dhcp_snoop_save(d):
1854 try:
1855 os.makedirs(os.path.dirname(_DHCP_SNOOP_PATH), exist_ok=True)
1856 tmp = _DHCP_SNOOP_PATH + '.tmp'
1857 with open(tmp, 'w') as f:
1858 json.dump(d, f, indent=2)
1859 os.replace(tmp, _DHCP_SNOOP_PATH)
1860 except OSError:
1861 pass
1862
1863
1864def _iface_master(iface):
1865 """The bridge (or bond) an interface is enslaved to, or None."""
1866 res = _run(['ip', '-o', 'link', 'show', 'dev', iface], timeout=5)
1867 m = re.search(r'\bmaster\s+(\S+)', res['out'])
1868 return m.group(1) if m else None
1869
1870

Callers 1

do_install_toolFunction · 0.85

Calls 2

_runFunction · 0.85
writeMethod · 0.45

Tested by

no test coverage detected