Esempio n. 1
0
def _load_existing_host_labels(
    *,
    host_name: HostName,
    discovery_parameters: DiscoveryParameters,
) -> Sequence[HostLabel]:
    # Take over old items if -I is selected
    if not discovery_parameters.load_labels:
        return []

    raw_label_dict = DiscoveredHostLabelsStore(host_name).load()
    return [
        HostLabel.from_dict(name, value)
        for name, value in raw_label_dict.items()
    ]
Esempio n. 2
0
def _load_existing_host_labels(host_name: HostName) -> Sequence[HostLabel]:
    raw_label_dict = DiscoveredHostLabelsStore(host_name).load()
    return [HostLabel.from_dict(name, value) for name, value in raw_label_dict.items()]