Beispiel #1
0
    def _validate_resource_types(self, resource_list):
        if not self.config_schema:
            self.config_schema = AWSServiceSpec(
                path="data/config/2014-11-12/service-2.json")

        # Verify that each entry exists in the supported list:
        bad_list = []
        for resource in resource_list:
            # For PY2:
            r_str = str(resource)

            if r_str not in self.config_schema.shapes["ResourceType"]["enum"]:
                bad_list.append(r_str)

        if bad_list:
            raise InvalidResourceTypeException(
                bad_list, self.config_schema.shapes["ResourceType"]["enum"])
Beispiel #2
0
    def _validate_resource_types(resource_list):
        # Load the service file:
        resource_package = 'botocore'
        resource_path = '/'.join(
            ('data', 'config', '2014-11-12', 'service-2.json'))
        config_schema = json.loads(
            pkg_resources.resource_string(resource_package, resource_path))

        # Verify that each entry exists in the supported list:
        bad_list = []
        for resource in resource_list:
            # For PY2:
            r_str = str(resource)

            if r_str not in config_schema['shapes']['ResourceType']['enum']:
                bad_list.append(r_str)

        if bad_list:
            raise InvalidResourceTypeException(
                bad_list, config_schema['shapes']['ResourceType']['enum'])
Beispiel #3
0
    def _validate_resource_types(resource_list):
        # Load the service file:
        resource_package = "botocore"
        resource_path = "/".join(
            ("data", "config", "2014-11-12", "service-2.json"))
        config_schema = json.loads(
            pkg_resources.resource_string(resource_package, resource_path))

        # Verify that each entry exists in the supported list:
        bad_list = []
        for resource in resource_list:
            # For PY2:
            r_str = str(resource)

            if r_str not in config_schema["shapes"]["ResourceType"]["enum"]:
                bad_list.append(r_str)

        if bad_list:
            raise InvalidResourceTypeException(
                bad_list, config_schema["shapes"]["ResourceType"]["enum"])