~larryprice/libertine/deb-filepicker

« back to all changes in this revision

Viewing changes to python/libertine/service/tasks/destroy_task.py

  • Committer: Larry Price
  • Date: 2017-03-09 17:26:36 UTC
  • mfrom: (388.2.46 devel)
  • Revision ID: larry.price@canonical.com-20170309172636-jketrvc7sj0wnzp0
merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2016 Canonical Ltd.
 
1
# Copyright 2016-2017 Canonical Ltd.
2
2
#
3
3
# This program is free software: you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
18
18
 
19
19
 
20
20
class DestroyTask(BaseTask):
21
 
    def __init__(self, container_id, config, lock, connection, callback):
22
 
        super().__init__(lock=lock, container_id=container_id, config=config, connection=connection, callback=callback)
 
21
    def __init__(self, container_id, config, lock, monitor, callback):
 
22
        super().__init__(lock=lock, container_id=container_id, config=config, monitor=monitor, callback=callback)
23
23
 
24
24
    def _run(self):
25
25
        utils.get_logger().debug("Destroying container '%s'" % self._container)
26
26
 
27
27
        container = LibertineContainer(self._container, self._config)
28
28
        if not container.destroy_libertine_container():
29
 
            self._progress.error("Destroying container '%s' failed" % self._container)
 
29
            self._error("Destroying container '%s' failed" % self._container)
30
30
            self._config.update_container_install_status(self._container, "ready")
31
31
            return
32
32
 
35
35
    def _before(self):
36
36
        utils.get_logger().debug("CreateTask::_before")
37
37
        if self._config._get_value_by_key(self._container, 'installStatus') != 'ready':
38
 
            self._progress.error("Container '%s' does not exist" % self._container)
 
38
            self._error("Container '%s' does not exist" % self._container)
39
39
            return False
40
40
 
41
41
        self._config.update_container_install_status(self._container, 'removing')