Closed jtdub closed 6 years ago
@jtdub What are your thoughts on having the following methods v.s. a single load method that takes a dict: Host.load_running_config(str)
, Host.load_running_config_from_file(str)
, Host.load_compiled_config(str)
, and Host.load_compiled_config_from_file(str)
?
Further, what are your thoughts on doing something like:
class Host:
def __init__(self):
self._running_config = None
self._compiled_config = None
@property
def running_config(self):
if self._running_config is None:
self._running_config = self._get_running_config()
return self._running_config
@property
def compiled_config(self):
if self._compiled_config is None:
self._compiled_config = self._get_compiled_config()
return self._compiled_config
def _get_running_config()
return NotImplemented
def _get_compiled_config()
return NotImplemented
This leaves the user free to inherit Host
and implement their own logic to retrieve running and compiled configs.
Consider ways to separate the concepts of generating the remediation and querying(e.g. get remediation by tag+lineage_rules) the remediation.
Ref: #28