Пример #1
0
    def __init__(self, file_path, parsed):
        """Creates a new ServiceYamlInfo.

    Args:
      file_path: str, The full path the file that was parsed.
      parsed: appinfo.AppInfoExternal, parsed Application Configuration.
    """
        super(ServiceYamlInfo, self).__init__(file_path, parsed)
        self.module = parsed.service or ServiceYamlInfo.DEFAULT_SERVICE_NAME

        if parsed.env in ['2', 'flex', 'flexible']:
            self.env = env.FLEX
        elif parsed.vm or parsed.runtime == 'vm':
            self.env = env.MANAGED_VMS
        else:
            self.env = env.STANDARD

        # All `env: flex` apps are hermetic. All `env: standard` apps are not
        # hermetic. All `vm: true` apps are hermetic IFF they don't use static
        # files.
        if self.env is env.FLEX:
            self.is_hermetic = True
        elif parsed.vm:
            for urlmap in parsed.handlers:
                if urlmap.static_dir or urlmap.static_files:
                    self.is_hermetic = False
                    break
            else:
                self.is_hermetic = True
        else:
            self.is_hermetic = False

        self._InitializeHasExplicitSkipFiles(file_path, parsed)
        self._UpdateSkipFiles(parsed)

        if (self.env is env.MANAGED_VMS) or self.is_hermetic:
            self.runtime = parsed.GetEffectiveRuntime()
            self._UpdateVMSettings()
        else:
            self.runtime = parsed.runtime

        # New "Ti" style runtimes
        self.is_ti_runtime = env.GetTiRuntimeRegistry().Get(
            self.runtime, self.env)
Пример #2
0
 def SetUp(self):
     self.registry = env.GetTiRuntimeRegistry()