mirror of
https://github.com/OpenKMIP/PyKMIP.git
synced 2025-07-21 21:14:24 +02:00
Adding a pending deprecation warning to old server
This change adds a simple warning that is triggered whenever the KMIPServer class is instantiated. It advises the user to use the newer KmipServer class. The KMIPServer will be removed in a future version of PyKMIP.
This commit is contained in:
parent
a3da0c6d46
commit
ab17f672ce
@ -17,6 +17,7 @@ import logging
|
|||||||
import os
|
import os
|
||||||
import socket
|
import socket
|
||||||
import ssl
|
import ssl
|
||||||
|
import warnings
|
||||||
|
|
||||||
from kmip.core.config_helper import ConfigHelper
|
from kmip.core.config_helper import ConfigHelper
|
||||||
from kmip.core.server import KMIPImpl
|
from kmip.core.server import KMIPImpl
|
||||||
@ -32,6 +33,14 @@ class KMIPServer(object):
|
|||||||
def __init__(self, host=None, port=None, keyfile=None, certfile=None,
|
def __init__(self, host=None, port=None, keyfile=None, certfile=None,
|
||||||
cert_reqs=None, ssl_version=None, ca_certs=None,
|
cert_reqs=None, ssl_version=None, ca_certs=None,
|
||||||
do_handshake_on_connect=None, suppress_ragged_eofs=None):
|
do_handshake_on_connect=None, suppress_ragged_eofs=None):
|
||||||
|
warnings.simplefilter("always")
|
||||||
|
warnings.warn((
|
||||||
|
"Please use the newer KmipServer located in kmip.services.server. "
|
||||||
|
"This version of the server will be deprecated in the future."),
|
||||||
|
PendingDeprecationWarning
|
||||||
|
)
|
||||||
|
warnings.simplefilter("default")
|
||||||
|
|
||||||
self.logger = logging.getLogger(__name__)
|
self.logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
self._set_variables(host, port, keyfile, certfile, cert_reqs,
|
self._set_variables(host, port, keyfile, certfile, cert_reqs,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user