mirror of
https://github.com/netinvent/npbackup.git
synced 2025-02-24 14:35:36 +08:00
Linter fixes
This commit is contained in:
parent
f47c3c8497
commit
a20ed911d9
1 changed files with 6 additions and 4 deletions
|
@ -369,9 +369,11 @@ class NPBackupRunner:
|
||||||
"""
|
"""
|
||||||
Make sure there we don't allow concurrent actions
|
Make sure there we don't allow concurrent actions
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@wraps(fn)
|
@wraps(fn)
|
||||||
def wrapper(self, *args, **kwargs):
|
def wrapper(self, *args, **kwargs):
|
||||||
locking_operations = ["backup", "repair", "forget", "prune", "raw", "unlock"]
|
locking_operations = ["backup", "repair", "forget", "prune", "raw", "unlock"]
|
||||||
|
# pylint: disable=E1101 (no-member)
|
||||||
if fn.__name__ in locking_operations:
|
if fn.__name__ in locking_operations:
|
||||||
pid_file = os.path.join(tempfile.gettempdir(), "{}.pid".format(__intname__))
|
pid_file = os.path.join(tempfile.gettempdir(), "{}.pid".format(__intname__))
|
||||||
try:
|
try:
|
||||||
|
@ -380,11 +382,10 @@ class NPBackupRunner:
|
||||||
result = fn(self, *args, **kwargs)
|
result = fn(self, *args, **kwargs)
|
||||||
except pidfile.AlreadyRunningError:
|
except pidfile.AlreadyRunningError:
|
||||||
# pylint: disable=E1101 (no-member)
|
# pylint: disable=E1101 (no-member)
|
||||||
self.write_logs("There is already an operation {fn.__name__} running. Will not continue", level="critical")
|
self.write_logs(f"There is already an {fn.__name__} operation running by NPBackup. Will not continue", level="critical")
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
# pylint: disable=E1102 (not-callable)
|
result = fn(self, *args, **kwargs) # pylint: disable=E1102 (not-callable)
|
||||||
result = fn(self, *args, **kwargs)
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
return wrapper
|
return wrapper
|
||||||
|
@ -808,7 +809,8 @@ class NPBackupRunner:
|
||||||
)
|
)
|
||||||
return False
|
return False
|
||||||
# Since we don't want to close queues nor create a subthread, we need to change behavior here
|
# Since we don't want to close queues nor create a subthread, we need to change behavior here
|
||||||
if self.has_recent_snapshot(__no_threads=True, __close_queues=False) and not force:
|
# pylint: disable=E1123 (unexpected-keyword-arg)
|
||||||
|
if self.has_recent_snapshot(__close_queues=False, __no_threads=True) and not force:
|
||||||
self.write_logs("No backup necessary.", level="info")
|
self.write_logs("No backup necessary.", level="info")
|
||||||
return True
|
return True
|
||||||
self.restic_runner.verbose = self.verbose
|
self.restic_runner.verbose = self.verbose
|
||||||
|
|
Loading…
Reference in a new issue