2
0
Эх сурвалжийг харах

refactor set_ec usage

- _export_tar: remove unneeded call to set_ec
  print_warning() already sets the exit code to EXIT_WARNING.

- msgpack version check: raise Error instead of calling set_ec
Thomas Waldmann 1 жил өмнө
parent
commit
add7a22581

+ 1 - 2
src/borg/archiver.py

@@ -1065,7 +1065,6 @@ class Archiver:
                 tarinfo.type = tarfile.FIFOTYPE
                 tarinfo.type = tarfile.FIFOTYPE
             else:
             else:
                 self.print_warning('%s: unsupported file type %o for tar export', remove_surrogates(item.path), modebits)
                 self.print_warning('%s: unsupported file type %o for tar export', remove_surrogates(item.path), modebits)
-                set_ec(EXIT_WARNING)
                 return None, stream
                 return None, stream
             return tarinfo, stream
             return tarinfo, stream
 
 
@@ -5195,7 +5194,7 @@ class Archiver:
             logger.error("You do not have a supported version of the msgpack python package installed. Terminating.")
             logger.error("You do not have a supported version of the msgpack python package installed. Terminating.")
             logger.error("This should never happen as specific, supported versions are required by our setup.py.")
             logger.error("This should never happen as specific, supported versions are required by our setup.py.")
             logger.error("Do not contact borgbackup support about this.")
             logger.error("Do not contact borgbackup support about this.")
-            return set_ec(EXIT_ERROR)
+            raise Error("unsupported msgpack version")
         if is_slow_msgpack():
         if is_slow_msgpack():
             logger.warning(PURE_PYTHON_MSGPACK_WARNING)
             logger.warning(PURE_PYTHON_MSGPACK_WARNING)
         if args.debug_profile:
         if args.debug_profile: