faucet.valve_util module

Utility functions for FAUCET.

faucet.valve_util.DEFAULTS = {'FAUCET_CONFIG': '/home/docs/checkouts/readthedocs.org/user_builds/faucet/envs/stable/etc/faucet/faucet.yaml:/home/docs/checkouts/readthedocs.org/user_builds/faucet/envs/stable/etc/ryu/faucet/faucet.yaml', 'FAUCET_CONFIG_STAT_RELOAD': False, 'FAUCET_EVENT_SOCK': '', 'FAUCET_EXCEPTION_LOG': '/home/docs/checkouts/readthedocs.org/user_builds/faucet/envs/stable/var/log/faucet/faucet_exception.log', 'FAUCET_LOG': '/home/docs/checkouts/readthedocs.org/user_builds/faucet/envs/stable/var/log/faucet/faucet.log', 'FAUCET_LOG_LEVEL': 'INFO', 'FAUCET_PROMETHEUS_ADDR': '0.0.0.0', 'FAUCET_PROMETHEUS_PORT': '9302', 'GAUGE_CONFIG': '/home/docs/checkouts/readthedocs.org/user_builds/faucet/envs/stable/etc/faucet/gauge.yaml:/home/docs/checkouts/readthedocs.org/user_builds/faucet/envs/stable/etc/ryu/faucet/gauge.yaml', 'GAUGE_CONFIG_STAT_RELOAD': False, 'GAUGE_EXCEPTION_LOG': '/home/docs/checkouts/readthedocs.org/user_builds/faucet/envs/stable/var/log/faucet/gauge_exception.log', 'GAUGE_LOG': '/home/docs/checkouts/readthedocs.org/user_builds/faucet/envs/stable/var/log/faucet/gauge.log', 'GAUGE_LOG_LEVEL': 'INFO', 'GAUGE_PROMETHEUS_ADDR': '0.0.0.0'}
faucet.valve_util.close_logger(logger)[source]

Close all handlers on logger object.

faucet.valve_util.dpid_log(dpid)[source]

Log a DP ID as hex/decimal.

faucet.valve_util.get_logger(logname, logfile, loglevel, propagate)[source]

Create and return a logger object.

faucet.valve_util.get_setting(name, path_eval=False)[source]

Returns value of specified configuration setting.

faucet.valve_util.get_sys_prefix()[source]

Returns an additional prefix for log and configuration files when used in a virtual environment

faucet.valve_util.kill_on_exception(logname)[source]

decorator to ensure functions will kill ryu when an unhandled exception occurs

faucet.valve_util.stat_config_files(config_hashes)[source]

Return dict of a subset of stat attributes on config files.

faucet.valve_util.utf8_decode(msg_str)[source]

Gracefully decode a possibly UTF-8 string.