Skip to content

Commit

Permalink
cleanup before deletion should be handled in backends; suspended = is…
Browse files Browse the repository at this point in the history
…_running
  • Loading branch information
Michel Käser committed Aug 8, 2015
1 parent 0bb3638 commit df8f646
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 19 deletions.
16 changes: 8 additions & 8 deletions ipynbsrv/admin/templates/admin/core/container/change_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ <h2>Actions</h2>
<fieldset class="module aligned ">
<h2>Status Actions</h2>
<div class="form-row">
{% if original.is_suspended %}
<input type="submit" value="{% trans 'Resume' %}" name="_resume" {{ onclick_attrib }} />
{% else %}
{% if original.is_running %}
<input type="submit" value="{% trans 'Restart' %}" name="_restart" {{ onclick_attrib }} />
<input type="submit" value="{% trans 'Stop' %}" name="_stop" {{ onclick_attrib }} />
<input type="submit" value="{% trans 'Suspend' %}" name="_suspend" {{ onclick_attrib }} />
{% if original.is_running %}
<input type="submit" value="{% trans 'Restart' %}" name="_restart" {{ onclick_attrib }} />
<input type="submit" value="{% trans 'Stop' %}" name="_stop" {{ onclick_attrib }} />
{% if original.is_suspended %}
<input type="submit" value="{% trans 'Resume' %}" name="_resume" {{ onclick_attrib }} />
{% else %}
<input type="submit" value="{% trans 'Start' %}" name="_start" {{ onclick_attrib }} />
<input type="submit" value="{% trans 'Suspend' %}" name="_suspend" {{ onclick_attrib }} />
{% endif %}
{% else %}
<input type="submit" value="{% trans 'Start' %}" name="_start" {{ onclick_attrib }} />
{% endif %}
</div>
</fieldset>
Expand Down
11 changes: 0 additions & 11 deletions ipynbsrv/core/signals/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,6 @@ def delete_on_server(sender, container, **kwargs):
Delete the destroyed container on the container_backend.
"""
if container is not None:
try:
if container.is_suspended():
container.resume()
except:
pass
try:
if container.is_running():
container.stop()
except:
pass

try:
container.server.get_container_backend().delete_container(container.backend_pk)
except ContainerNotFoundError as ex:
Expand Down

0 comments on commit df8f646

Please sign in to comment.