def load_live(self): """ Loads the live-running configuration. """ from config_live import dump_live live = dump_live() parse_tree = self._parser.parse_string(live) source = {"operation": "resync", "timestamp": time.time()} self._load_parse_tree(parse_tree, replace=True, source=source, allow_new_attrs=True)
def diff_live(self): """ Returns a diff between the current configuration and the live configuration as a reference. """ from config_live import dump_live parse_tree = self._parser.parse_string(dump_live()) source = {"operation": "load", "timestamp": time.time()} self._load_parse_tree(parse_tree, replace=True, source=source, target="reference", allow_new_attrs=True) return self.diff()
def load_live(self): ''' Loads the live-running configuration. ''' from config_live import dump_live live = dump_live() parse_tree = self._parser.parse_string(live) source = {'operation': 'resync', 'timestamp': time.time()} self._load_parse_tree(parse_tree, replace=True, source=source, allow_new_attrs=True)
def diff_live(self): ''' Returns a diff between the current configuration and the live configuration as a reference. ''' from config_live import dump_live parse_tree = self._parser.parse_string(dump_live()) source = {'operation': 'load', 'timestamp': time.time()} self._load_parse_tree(parse_tree, replace=True, source=source, target='reference', allow_new_attrs=True) return self.diff()