@classmethod
    def from_spec(cls, spec, validator_map, resource_roots):
        jsonschema.validate(spec, cls.SPEC_SCHEMA)

        if isinstance(spec, six.string_types):
            script_path = spec
            env_vars, output_var = cls._DEFAULT_ENV_VARS, None
        else:
            script_path, properties = list(six.iteritems(spec))[0]
            env_vars = cls._DEFAULT_ENV_VARS + properties.get('env_vars', [])
            output_var = properties.get('output', None)

        script_contents = None
        for root in resource_roots:
            file_path = path.join(root, script_path)
            script_contents = files.try_get_file_text(file_path)
            if script_contents:
                break

        if not script_contents:
            raise p_ex.ImageValidationSpecificationError(
                _("Script %s not found in any resource roots.") % script_path)

        return SaharaScriptValidator(script_contents, env_vars, output_var)
Wait for the specified app_id to be listed in marathon.
dataset/ETHPy150Open openstack/sahara/sahara/plugins/images.py/SaharaScriptValidator.from_spec--crossover with--dataset/ETHPy150Open Yelp/paasta/paasta_tools/bounce_lib.py/wait_for_create