Commit 3bd3f400 authored by Petr Pudlak's avatar Petr Pudlak

Add __str__ methods for Python livelock classess

.. so that they are displayed properly in logs.
Signed-off-by: default avatarPetr Pudlak <pudlak@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent 445c5ec4
...@@ -47,6 +47,9 @@ class LiveLockName(object): ...@@ -47,6 +47,9 @@ class LiveLockName(object):
""" """
os.remove(self._name) os.remove(self._name)
def __str__(self):
return "LiveLockName(" + self.GetPath() + ")"
class LiveLock(object): class LiveLock(object):
"""Utility for a lockfile needed to request resources from WconfD. """Utility for a lockfile needed to request resources from WconfD.
...@@ -73,6 +76,9 @@ class LiveLock(object): ...@@ -73,6 +76,9 @@ class LiveLock(object):
self.lockfile.close() self.lockfile.close()
os.remove(self.lockfile.name) os.remove(self.lockfile.name)
def __str__(self):
return "LiveLock(" + self.GetPath() + ")"
def GuessLockfileFor(name): def GuessLockfileFor(name):
"""For a given name, take the latest file matching. """For a given name, take the latest file matching.
......
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 to comment