Skip to content
This repository was archived by the owner on Aug 11, 2020. It is now read-only.

Commit 300bfae

Browse files
committed
Fix projectId-projectHandle names
1 parent 681ad9f commit 300bfae

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

paperspace/cli/jobs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def common_jobs_create_options(f):
8484
click.option("--useDockerfile", "useDockerfile", help="Flag: using Dockerfile"),
8585
click.option("--isPreemptible", "isPreemptible", help="Flag: isPreemptible"),
8686
click.option("--project", "project", help="Project name"),
87-
click.option("--projectId", "projectHandle", help="Project ID"),
87+
click.option("--projectId", "projectId", help="Project ID"),
8888
click.option("--startedByUserId", "startedByUserId", help="User ID"),
8989
click.option("--relDockerfilePath", "relDockerfilePath", help="Relative path to Dockerfile"),
9090
click.option("--registryUsername", "registryUsername", help="Docker registry username"),

paperspace/commands/jobs.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def _get_logs(self, job_id, line, limit):
108108
'jobId': job_id,
109109
'line': line,
110110
'limit': limit
111-
};
111+
}
112112
return self.api.get(self.base_url, params=params)
113113

114114
def _log_logs_list(self, data, table, table_data, follow):
@@ -150,7 +150,7 @@ def __init__(self, workspace_handler=None, **kwargs):
150150
def execute(self, json_):
151151
url = "/jobs/createJob/"
152152
data = None
153-
self.set_project(json_)
153+
self.set_project_if_not_provided(json_)
154154

155155
workspace_url = self._workspace_handler.handle(json_)
156156
if workspace_url:
@@ -179,13 +179,8 @@ def _get_files_dict(self, archive_basename):
179179
return job_data
180180

181181
@staticmethod
182-
def set_project(json_):
183-
if json_.get("projectId"):
184-
return
185-
186-
if json_.get("projectHandle"):
187-
json_["projectId"] = json_.pop("projectHandle")
188-
else:
182+
def set_project_if_not_provided(json_):
183+
if not json_.get("projectId"):
189184
json_["project"] = "paperspace-python"
190185

191186

0 commit comments

Comments
 (0)