Example #1
0
 def validate_host(self, host):
     """Validate host input that it contains everything needed by provider."""
     # attribute check
     validate_dict_attrs(host, self._required_host_attrs, "host")
     # provider check
     provider = host.get("provider")
     if provider and provider not in providers.names:
         raise MetadataError(f"Error: Invalid host provider: {provider}")
Example #2
0
    def validate_topology(self):
        """Validate topology part of job metadata.

        Raises: MetadataError
        """
        if "domains" not in self._metadata:
            error = (
                "Error: job metadata file doesn't contain required "
                "`domains` definition"
            )
            raise MetadataError(error)
        for domain in self._metadata["domains"]:
            validate_dict_attrs(domain, self._required_domain_attrs, "domain")
Example #3
0
 def validate_config(self):
     """Validate provisioning configuration for this transformer/provider."""
     validate_dict_attrs(self.config, self._required_config_attrs, "config")