'Determines if the app\'s api_version is supported by the SDK.
Uses the api_version field from the AppInfoExternal to determine if
the SDK supports that api_version.
Raises:
sys.exit if the api_version is not supported.'

def CheckSupportedVersion(self):

    version = self._ParseVersionFile()
    if (version is None):
        logging.error('Could    not    determine    if    the    SDK    supports    the    api_version    requested    in    app.yaml.')
        return
    unsupported_api_versions_found = False
    for (runtime, api_versions) in self.runtime_to_api_version.items():
        supported_api_versions = _GetSupportedApiVersions(version, runtime)
        unsupported_api_versions = sorted((api_versions - set(supported_api_versions)))
        if unsupported_api_versions:
            unsupported_api_versions_found = True
            if (len(unsupported_api_versions) == 1):
                logging.critical('The    requested    api_version    (%s)    is    not    supported    by    the    %s    runtime    in    this    release    of    the    SDK.    The    supported    api_versions    are    %s.', unsupported_api_versions[0], runtime, supported_api_versions)
            else:
                logging.critical('The    requested    api_versions    (%s)    are    not    supported    by    the    %s    runtime    in    this    release    of    the    SDK.    The    supported    api_versions    are    %s.', unsupported_api_versions, runtime, supported_api_versions)
    if unsupported_api_versions_found:
        sys.exit(1)
