def discover_versions(self, protocol_versions=None):
        self.logger.debug(
            "discover_versions(protocol_versions={0}) called".format(
                protocol_versions))
        msg = 'get protocol versions supported by server'

        result_versions = list()
        if protocol_versions:
            msg += " and client; client versions {0}".format(protocol_versions)
            for version in protocol_versions:
                if version in self.protocol_versions:
                    result_versions.append(version)
        else:
            result_versions = self.protocol_versions

        self.logger.debug(msg)
        try:
            return DiscoverVersionsResult(ResultStatus(RS.SUCCESS),
                                          protocol_versions=result_versions)
        except Exception:
            msg = ResultMessage('DiscoverVersions Operation Failed')
            reason = ResultReason(ResultReasonEnum.GENERAL_FAILURE)
            return DiscoverVersionsResult(ResultStatus(RS.OPERATION_FAILED),
                                          result_reason=reason,
                                          result_message=msg)
dataset/ETHPy150Open OpenKMIP/PyKMIP/kmip/core/server.py/KMIPImpl.discover_versions/original