Skip to content

Commit 223fc6f

Browse files
committed
make start/stop from monitor use git
1 parent 0703463 commit 223fc6f

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

src/edge_containers_cli/cmds/argo_commands.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,14 @@ def restart(self, service_name):
204204
)
205205
shell.run_command(cmd, skip_on_dryrun=True)
206206

207-
def start(self, service_name, commit=False):
207+
def start(self, service_name, commit=True):
208208
self._check_stoppable(service_name)
209209
if commit:
210210
push_value(self.target, f"services.{service_name}.enabled", True)
211211
else:
212212
patch_value(self.target, f"services.{service_name}.enabled", True)
213213

214-
def stop(self, service_name, commit=False):
214+
def stop(self, service_name, commit=True):
215215
self._check_stoppable(service_name)
216216
if commit:
217217
push_value(self.target, f"services.{service_name}.enabled", False)

src/edge_containers_cli/cmds/demo_commands.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,6 @@ def _start(self, service_name, commit=False):
118118

119119
@demo_message
120120
def stop(self, service_name, commit=False):
121-
# used to demo catching exceptions in the UI thread
122-
raise CommandError(f"{service_name} does not support stop/start")
123121
self._stop(service_name, commit=commit)
124122

125123
def _stop(self, service_name, commit=False):

src/edge_containers_cli/cmds/monitor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535

3636
from edge_containers_cli.cmds.commands import CommandError, Commands
3737
from edge_containers_cli.definitions import ECLogLevels, Emoji
38+
from edge_containers_cli.git import GitError
3839
from edge_containers_cli.logging import log
3940
from edge_containers_cli.shell import ShellError
4041

@@ -474,7 +475,7 @@ def do_work(self):
474475
job = self._queue.get(timeout=1)
475476
job()
476477
self._queue.task_done()
477-
except (CommandError, ShellError) as e:
478+
except (CommandError, ShellError, GitError) as e:
478479
self.app.call_from_thread(
479480
partial(self.push_screen, ErrorScreen(str(e)))
480481
)

0 commit comments

Comments
 (0)