Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Rename 'dbus_object' with 'task'

We were exploiting the fact it was a task rather than a plain
dbus object, so this makes the code more obvious.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
  • Loading branch information...
commit 3b9cb0bb4695443a61bd7e3f219fd057291bbf8a 1 parent 982b41c
@djs55 authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 dbus/vm/python/dbus-resource-script.py
View
12 dbus/vm/python/dbus-resource-script.py
@@ -72,13 +72,13 @@ def error(message):
class Canceller(threading.Thread):
"""A thread which attempts to cleanly shutdown a process, resorting
to SIGKILL if it fails to respond after a timeout"""
- def __init__(self, process, dbus_object):
+ def __init__(self, process, task):
threading.Thread.__init__(self)
self.process = process
- self.dbus_object = dbus_object
+ self.task = task
self.start()
def run(self):
- info("%s: cancelling: sending SIGTERM to %d" % (self.dbus_object.path, self.process.pid))
+ info("%s: cancelling: sending SIGTERM to %d" % (self.task.path, self.process.pid))
try:
self.process.terminate()
except:
@@ -89,7 +89,7 @@ def run(self):
sys.stdout.flush()
time.sleep(1)
if self.process.poll() <> None:
- info("%s: cancelling: sending SIGKILL to %d" % (self.dbus_object.path, self.process.pid))
+ info("%s: cancelling: sending SIGKILL to %d" % (self.task.path, self.process.pid))
try:
self.process.kill()
except:
@@ -98,8 +98,8 @@ def run(self):
self.process.wait()
except:
pass
- info("%s: cancelling: deleting object" % self.dbus_object.path)
- self.dbus_object.remove_from_connection()
+ info("%s: cancelling: deleting object" % self.task.path)
+ self.task.remove_from_connection()
class Task(dbus.service.Object, threading.Thread):
Please sign in to comment.
Something went wrong with that request. Please try again.