X-Git-Url: https://wannabe.guru.org/gitweb/?a=blobdiff_plain;f=lockfile.py;h=ebd91158a54b80ed275bed990a3d9e35fedb0e0f;hb=298a4ff1dca7c75993eae2317a777829828ae04a;hp=7f10cc1f5894155c65ca352183afc0ea6d81fa37;hpb=b454ad295eb3024a238d32bf2aef1ebc3c496b44;p=python_utils.git diff --git a/lockfile.py b/lockfile.py index 7f10cc1..ebd9115 100644 --- a/lockfile.py +++ b/lockfile.py @@ -90,7 +90,6 @@ class LockFile(object): pass msg = f'Could not acquire {self.lockfile}.' logger.warning(msg) - warnings.warn(msg) return False def acquire_with_retries( @@ -127,7 +126,6 @@ class LockFile(object): return self msg = f"Couldn't acquire {self.lockfile}; giving up." logger.warning(msg) - warnings.warn(msg) raise LockFileException(msg) def __exit__(self, type, value, traceback): @@ -154,7 +152,6 @@ class LockFile(object): cmd = self.override_command else: cmd = ' '.join(sys.argv) - print(cmd) contents = LockFileContents( pid = os.getpid(), commandline = cmd, @@ -178,7 +175,6 @@ class LockFile(object): except OSError: msg = f'Lockfile {self.lockfile}\'s pid ({contents.pid}) is stale; force acquiring' logger.warning(msg) - warnings.warn(msg) self.release() # Has the lock expiration expired? @@ -187,7 +183,6 @@ class LockFile(object): if now > contents.expiration_datetime: msg = f'Lockfile {self.lockfile} expiration time has passed; force acquiring' logger.warning(msg) - warnings.warn(msg) self.release() except Exception: pass