Skip to content

Commit 9904dbe

Browse files
Fixing the log error (#465)
* Fixing the log error * Adjusting to the feedback: - deferring the check after the initialization
1 parent c343d35 commit 9904dbe

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

dask_cloudprovider/gcp/instances.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,8 +649,6 @@ def __init__(
649649
if not self.ngpus:
650650
self.scheduler_ngpus = scheduler_ngpus if scheduler_ngpus is not None else self.config.get("scheduler_ngpus", 0)
651651
self.worker_ngpus = worker_ngpus if worker_ngpus is not None else self.config.get("worker_ngpus", 0)
652-
if self.scheduler_ngpus == 0 and self.worker_ngpus == 0:
653-
self._log("No GPU instances configured")
654652
else:
655653
if scheduler_ngpus is not None or worker_ngpus is not None:
656654
raise ValueError("If you specify ngpus, you may not specify scheduler_ngpus or worker_ngpus")
@@ -713,6 +711,9 @@ def __init__(
713711

714712
super().__init__(debug=debug, **kwargs)
715713

714+
if not self.ngpus and (self.scheduler_ngpus == 0 and self.worker_ngpus == 0):
715+
self._log("No GPU instances configured")
716+
716717

717718
class GCPCompute:
718719
"""

0 commit comments

Comments
 (0)