From e612e26103453987996e69c112c0bd32271a019d Mon Sep 17 00:00:00 2001 From: Robert Nishihara Date: Thu, 1 Nov 2018 14:16:04 -0700 Subject: [PATCH] Add use_raylet option for backwards compatibility. (#3176) * Add use_raylet option for backwards compatibility. * Update message. --- python/ray/worker.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/python/ray/worker.py b/python/ray/worker.py index 83232c7e5..7f5d28752 100644 --- a/python/ray/worker.py +++ b/python/ray/worker.py @@ -1513,7 +1513,8 @@ def init(redis_address=None, logging_format=ray_constants.LOGGER_FORMAT, plasma_store_socket_name=None, raylet_socket_name=None, - temp_dir=None): + temp_dir=None, + use_raylet=None): """Connect to an existing Ray cluster or start one and connect to it. This method handles two cases. Either a Ray cluster already exists and we @@ -1591,6 +1592,15 @@ def init(redis_address=None, Exception: An exception is raised if an inappropriate combination of arguments is passed in. """ + # Add the use_raylet option for backwards compatibility. + if use_raylet is not None: + if use_raylet: + logger.warn("WARNING: The use_raylet argument has been " + "deprecated. Please remove it.") + else: + raise DeprecationWarning("The use_raylet argument is deprecated. " + "Please remove it.") + if configure_logging: logging.basicConfig(level=logging_level, format=logging_format)