google.cloud.forseti.scanner.scanners.config_validator_util.cv_data_converter module

Config Validator Data Converter.

cleanup_dict(raw_dict)[source]

Replace empty value to None in dict.

Parameters:raw_dict (dict) – Dict to clean up.
convert_data_to_cv_asset(resource, data_type)[source]

Convert data to CAI format.

Parameters:
  • resource (Resource) – Resource from querying the resources table.
  • data_type (str) – Type of the data, can either be ‘resource’ or ‘iam_policy’.
Returns:

A Config Validator Asset.

Return type:

Asset

Raises:

ValueError – if data_type is have an unexpected type.

generate_ancestry_path(full_name)[source]

Generate ancestry path from full_name.

Parameters:full_name (str) – Full name of the resource.
Returns:Ancestry path.
Return type:str
resource_wrapper(data)[source]

Wrap the data with the resource wrapper used by CAI.

Parameters:data (dict) – The resource data.
Returns:Resource data wrapped by a resource wrapper.
Return type:dict