Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

CIRCLE / storagedriver

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 2
  • Merge Requests 4
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Commits
  • Issue Boards
Merged
Merge request !4 opened Jul 08, 2014 by Guba Sándor@gubasandor 
  • Report abuse
Report abuse

Feature Abort Save As

Make save_as job abortable.

qcow2-snapshot image handled by Process.Popen (qemu-img) qcow2-norm handled by Threded shutil copy iso-s simlink is not abortable (fast operation)

  • Discussion 3
  • Commits 3
  • Changes
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
  • Őry Máté
    @orymate started a discussion on the diff Jul 09, 2014
    disk.py
    251 def merge(self, task, new_disk):
    250 252 """ Merging a new_disk from the actual disk and its base.
    251 253 """
    254 from time import sleep
    255 import threading
    256
    257 class AbortException(Exception):
    258 pass
    259 if task.is_aborted():
    260 raise AbortException()
    252 261 # Check if file already exists
    253 262 if os.path.isfile(new_disk.get_path()):
    254 263 raise Exception('File already exists: %s' % self.get_path())
    255 264 if self.format == "iso":
    256 265 os.symlink(self.get_path(), new_disk.get_path())
    257 266 elif self.base_name:
    • Őry Máté @orymate commented Jul 09, 2014
      Owner

      the next two blocks could be separate functions

      the next two blocks could be separate functions
    Please register or sign in to reply
  • Őry Máté
    @orymate started a discussion on an old version of the diff Jul 09, 2014
    disk.py
    292 try:
    293 t = threading.Thread(
    294 target=copy,
    295 args=(
    296 self.get_path(),
    297 new_disk.get_path()))
    298 while True:
    299 if not t.isAlive():
    300 break
    301 if task.is_aborted():
    302 logger.warning(
    303 "Merging new disk %s is aborted by user.",
    304 new_disk.get_path())
    305 raise AbortException
    306 except AbortException:
    307 t._Thread__stop()
    • Őry Máté @orymate commented Jul 09, 2014
      Owner

      did you check if this really works?

      did you check if this really works?
    Please register or sign in to reply
  • Őry Máté @orymate commented Jul 09, 2014
    Owner

    +1

    +1
  • Write
  • Preview
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment
Assignee
No assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
0
Labels
None
Assign labels
  • View labels
2
2 participants
Reference: circle/storagedriver!4