Skip to content

Commit 231424c

Browse files
committed
Remove unused enums
1 parent 95ad5f2 commit 231424c

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

src/firebolt/model/V2/database.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ def delete(self) -> None:
8383
for engine in self.get_attached_engines():
8484
if engine.current_status in {
8585
EngineStatus.STARTING,
86+
EngineStatus.DRAINING,
8687
EngineStatus.STOPPING,
8788
}:
8889
raise AttachedEngineInUseError(method_name="delete")

src/firebolt/model/V2/engine.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def start(self) -> Engine:
140140
if self.current_status == EngineStatus.RUNNING:
141141
logger.info(f"Engine {self.name} is already running.")
142142
return self
143-
if self.current_status in (EngineStatus.DROPPING, EngineStatus.REPAIRING):
143+
if self.current_status in (EngineStatus.DRAINING,):
144144
raise ValueError(
145145
f"Unable to start engine {self.name} because it's "
146146
f"in {self.current_status.value.lower()} state"
@@ -163,7 +163,7 @@ def stop(self) -> Engine:
163163
if self.current_status == EngineStatus.STOPPED:
164164
logger.info(f"Engine {self.name} is already stopped.")
165165
return self
166-
if self.current_status in (EngineStatus.DROPPING, EngineStatus.REPAIRING):
166+
if self.current_status in (EngineStatus.DRAINING,):
167167
raise ValueError(
168168
f"Unable to stop engine {self.name} because it's "
169169
f"in {self.current_status.value.lower()} state"
@@ -206,7 +206,7 @@ def update(
206206

207207
self.refresh()
208208
self._wait_for_start_stop()
209-
if self.current_status in (EngineStatus.DROPPING, EngineStatus.REPAIRING):
209+
if self.current_status in (EngineStatus.DRAINING,):
210210
raise ValueError(
211211
f"Unable to update engine {self.name} because it's "
212212
f"in {self.current_status.value.lower()} state"
@@ -243,7 +243,7 @@ def update(
243243
def delete(self) -> None:
244244
"""Delete an engine."""
245245
self.refresh()
246-
if self.current_status in [EngineStatus.DROPPING, EngineStatus.DELETING]:
246+
if self.current_status in [EngineStatus.DRAINING, EngineStatus.DELETING]:
247247
return
248248
with self._service._connection.cursor() as c:
249249
c.execute(self.DROP_SQL.format(self.name))

src/firebolt/service/V2/types.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,9 @@ class EngineStatus(Enum):
88
"""
99

1010
STARTING = "STARTING"
11-
STARTED = "STARTED"
1211
RUNNING = "RUNNING"
1312
STOPPING = "STOPPING"
1413
STOPPED = "STOPPED"
15-
DROPPING = "DROPPING"
16-
REPAIRING = "REPAIRING"
17-
FAILED = "FAILED"
1814
DELETING = "DELETING"
1915
RESIZING = "RESIZING"
2016
DRAINING = "DRAINING"

0 commit comments

Comments
 (0)