[tune] Remove py2.7-specific code (#6665)

* Remove backwards compatability py2.7 code.

* Use exists_ok=True in ray

* nit

* nit

Co-authored-by: Richard Liaw <rliaw@berkeley.edu>
This commit is contained in:
Ujval Misra
2020-01-03 04:03:13 -05:00
committed by Richard Liaw
parent 970cd78701
commit 5b40408678
9 changed files with 18 additions and 52 deletions
+4 -4
View File
@@ -198,7 +198,7 @@ class Node:
else:
self._temp_dir = ray.utils.decode(redis_client.get("temp_dir"))
try_to_create_directory(self._temp_dir, warn_if_exist=False)
try_to_create_directory(self._temp_dir)
if self.head:
self._session_dir = os.path.join(self._temp_dir, self.session_name)
@@ -212,12 +212,12 @@ class Node:
try_to_symlink(session_symlink, self._session_dir)
# Create a directory to be used for socket files.
self._sockets_dir = os.path.join(self._session_dir, "sockets")
try_to_create_directory(self._sockets_dir, warn_if_exist=False)
try_to_create_directory(self._sockets_dir)
# Create a directory to be used for process log files.
self._logs_dir = os.path.join(self._session_dir, "logs")
try_to_create_directory(self._logs_dir, warn_if_exist=False)
try_to_create_directory(self._logs_dir)
old_logs_dir = os.path.join(self._logs_dir, "old")
try_to_create_directory(old_logs_dir, warn_if_exist=False)
try_to_create_directory(old_logs_dir)
def get_resource_spec(self):
"""Resolve and return the current resource spec for the node."""