diff --git a/rbackup/rsync.py b/rbackup/rsync.py index 3ccfe21..a7e9062 100644 --- a/rbackup/rsync.py +++ b/rbackup/rsync.py @@ -34,7 +34,7 @@ def rsync(*args): """ cmd = [_RSYNC_BIN, *args] - syslog.debug(f"rsync command: {cmd}") + syslog.debug("rsync command: %s", cmd) syslog.info("Beginning rsync process") process = subprocess.run(cmd, capture_output=True, check=True, text=True) diff --git a/rbackup/script.py b/rbackup/script.py index 173fdfa..bb83025 100644 --- a/rbackup/script.py +++ b/rbackup/script.py @@ -75,6 +75,6 @@ def do_backup(repository, parsed_config, args, extra_rsync_opts=None): exit(E_INVALID_SNAPSHOT_NAME) except CalledProcessError as e: syslog.critical("Backup process failed") - syslog.critical(f"Failing command: {e.cmd}") + syslog.critical("Failing command: %s", e.cmd) syslog.critical(e.stderr) exit(e.returncode) diff --git a/rbackup/struct/hierarchy.py b/rbackup/struct/hierarchy.py index fff85ad..7c8965b 100644 --- a/rbackup/struct/hierarchy.py +++ b/rbackup/struct/hierarchy.py @@ -101,7 +101,7 @@ class Hierarchy(os.PathLike): def cleanup(self, **kwargs): """Clean up this Hierarchy's data from the filesystem.""" - syslog.info(f"Performing cleanup on {self._path}") + syslog.info("Performing cleanup on %s", self._path) # We don't want to risk symlink attacks # noinspection PyUnresolvedReferences @@ -119,7 +119,7 @@ class Hierarchy(os.PathLike): :rtype: type that the data is serialized as """ - syslog.debug(f"Reading metadata from {self.metadata_path}") + syslog.debug("Reading metadata from %s", self.metadata_path) with self.metadata_path.open(mode=METADATA_READ) as mfile: return json.load(mfile) @@ -131,7 +131,7 @@ class Hierarchy(os.PathLike): :param attr: class data to write to file :type attr: any type """ - syslog.debug(f"Writing metadata to {self.metadata_path}") + syslog.debug("Writing metadata to %s", self.metadata_path) tmpfile = self.metadata_path.with_suffix(".tmp") diff --git a/rbackup/struct/repository.py b/rbackup/struct/repository.py index 1b82b9f..8382fd5 100644 --- a/rbackup/struct/repository.py +++ b/rbackup/struct/repository.py @@ -232,7 +232,7 @@ class Repository(Hierarchy): self.metadata_path.unlink() self.snapshot_symlink.unlink() syslog.info("Removing repository metadata") - syslog.debug(f"Repository metadata removed: {self.metadata_path}") + syslog.debug("Repository metadata removed: %s", self.metadata_path) if remove_snapshots: try: @@ -248,7 +248,7 @@ class Repository(Hierarchy): except PermissionError as e: syslog.error(e) else: - syslog.info(f"Removed repository directory: {self.path}") + syslog.info("Removed repository directory: %s", self.path) def create_snapshot(self, name=None): """Create a new snapshot in this repository. @@ -295,7 +295,7 @@ class Repository(Hierarchy): self.write_metadata(self._snapshot_metadata) syslog.debug("Snapshot created") - syslog.debug(f"Snapshot name: {new_snapshot.name}") + syslog.debug("Snapshot name: %s", new_snapshot.name) self.symlink_snapshot(new_snapshot) return new_snapshot