diff options
author | Julien Dessaux | 2021-10-05 14:25:38 +0200 |
---|---|---|
committer | Julien Dessaux | 2021-10-05 14:25:38 +0200 |
commit | 42790f21cd88b5c2c3190ba2043e4f8f6026ac29 (patch) | |
tree | b42a36c93741e5d08f9ef210e286befb8f054d25 | |
parent | Fixed borg server account for Alpine Linux (diff) | |
download | borg-ansible-role-42790f21cd88b5c2c3190ba2043e4f8f6026ac29.tar.gz borg-ansible-role-42790f21cd88b5c2c3190ba2043e4f8f6026ac29.tar.bz2 borg-ansible-role-42790f21cd88b5c2c3190ba2043e4f8f6026ac29.zip |
Allow hyphens in borg job name1.2.2
-rw-r--r-- | action_plugins/borg_validate.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/action_plugins/borg_validate.py b/action_plugins/borg_validate.py index 16d97ec..5819b80 100644 --- a/action_plugins/borg_validate.py +++ b/action_plugins/borg_validate.py @@ -39,8 +39,8 @@ class ActionModule(ActionBase): error_msgs.append(f"Invalid job for host {task_vars['ansible_host']} : no name defined") elif not isinstance(job['name'], str): error_msgs.append(f"Invalid job name for host {task_vars['ansible_host']} : name must be of type string") - elif not re.match(r'^[a-zA-Z0-9_]+$', job['name']): - error_msgs.append(f"Invalid job name for host {task_vars['ansible_host']} : name must match ^[a-zA-Z0-9_]+$") + elif not re.match(r'^[a-zA-Z0-9_-]+$', job['name']): + error_msgs.append(f"Invalid job name for host {task_vars['ansible_host']} : name must match ^[a-zA-Z0-9_-]+$") # path and command_to_pipe are mutually exclusive if 'path' in job.keys() and 'command_to_pipe' in job.keys(): error_msgs.append(f"Invalid job for host {task_vars['ansible_host']} : it needs either a path or a command_to_pipe, not both") |