Scanner for the resource location rules engine.

class LocationScanner(global_configs, scanner_configs, service_config, model_name, snapshot_timestamp, rules)[source]


Scanner for resource locations.

_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 186
_abc_registry = <_weakrefset.WeakSet object>

Find location violations in the given resources.

Parameters:resources (List[resource]) – resources to check for violations in.
Returns:A list of all violations.
Return type:List[RuleViolation]
static _flatten_violations(violations)[source]

Flatten violations into a dict.

Parameters:violations (List[RuleViolation]) – The violations to flatten.
Yields:Iterator[dict] – flattened violations for each violation.

Output results.

Parameters:all_violations (List[RuleViolation]) – A list of resource location violations.

Retrieves the data for scanner.

Returns:resources to check for violations.
Return type:List[Resource]
Raises:ValueError – if resources have an unexpected type.

Runs the data collection.