Account for permission errors
This commit is contained in:
parent
43d4a07d26
commit
93b55cda9b
@ -42,6 +42,7 @@ EXTRA_RSYNC_OPTS = {
|
|||||||
# ----- Error Codes -----
|
# ----- Error Codes -----
|
||||||
E_FAILED_PROCESS = 1
|
E_FAILED_PROCESS = 1
|
||||||
E_INVALID_SNAPSHOT_NAME = 2
|
E_INVALID_SNAPSHOT_NAME = 2
|
||||||
|
E_PERMISSION = 13
|
||||||
|
|
||||||
# ========== Logging Setup ==========
|
# ========== Logging Setup ==========
|
||||||
console_formatter = logging.Formatter(LOGFORMAT)
|
console_formatter = logging.Formatter(LOGFORMAT)
|
||||||
@ -117,7 +118,12 @@ def change_umask():
|
|||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
args = parse_cmdline_arguments()
|
args = parse_cmdline_arguments()
|
||||||
parsed_config = config.parse_configfile()
|
parsed_config = config.parse_configfile()
|
||||||
|
|
||||||
|
try:
|
||||||
repo = Repository(args.repository)
|
repo = Repository(args.repository)
|
||||||
|
except PermissionError as e:
|
||||||
|
syslog.critical(e)
|
||||||
|
exit(E_PERMISSION)
|
||||||
|
|
||||||
rsync_opts = config.load_list_from_option(
|
rsync_opts = config.load_list_from_option(
|
||||||
parsed_config,
|
parsed_config,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user