Changeset 40967 for trunk/tools/backups/utils/subprocess_utils.py
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/ipp-259_genericise_backups (added) merged: 40910-40913,40915,40919-40924,40931-40932,40937,40944-40945,40949-40952,40958-40959,40962-40963,40966
- Property svn:mergeinfo changed
-
trunk/tools
- Property svn:mergeinfo changed
/branches/ipp-259_genericise_backups/tools (added) merged: 40911-40913,40915,40919-40924,40931-40932,40937,40944-40945,40949-40952,40958-40959,40962-40963,40966
- Property svn:mergeinfo changed
-
trunk/tools/backups/utils/subprocess_utils.py
r40898 r40967 2 2 3 3 # Plans are to flesh this out a bit more to make some smarter copying etc 4 from backups.utils.errors import ValidationError, SubprocessError4 from .errors import ValidationError, SubprocessError 5 5 6 6 … … 34 34 35 35 36 def local_rsync_wrapper(args: [str]): 37 if args is None: 38 raise ValidationError(f"Error:no arguments provided to {local_rsync_wrapper.__name__}") 39 command_and_args = ["rsync"] + args 40 return simple_unix_wrapper(command_and_args) 41 42 36 43 def simple_unix_wrapper(command_and_args: [str]): 37 44 """ This should provide the program name and all arguments in a list. … … 42 49 43 50 try: 44 subprocess .check_call(command_and_args)51 subprocess_exitcode = subprocess.check_call(command_and_args) 45 52 except (subprocess.CalledProcessError) as cpe: 46 53 raise SubprocessError(f"{type(cpe)} in python simple_unix_wrapper") from cpe 47 54 except (ValidationError) as ve: 48 55 raise ValidationError(f"{type(ve)} in python simple_unix_wrapper") from ve 49 return 056 return subprocess_exitcode
Note:
See TracChangeset
for help on using the changeset viewer.
