Allow hyphens in borg job name
This commit is contained in:
parent
277f232657
commit
42790f21cd
1 changed files with 2 additions and 2 deletions
|
@ -39,8 +39,8 @@ class ActionModule(ActionBase):
|
||||||
error_msgs.append(f"Invalid job for host {task_vars['ansible_host']} : no name defined")
|
error_msgs.append(f"Invalid job for host {task_vars['ansible_host']} : no name defined")
|
||||||
elif not isinstance(job['name'], str):
|
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")
|
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']):
|
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_]+$")
|
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
|
# path and command_to_pipe are mutually exclusive
|
||||||
if 'path' in job.keys() and 'command_to_pipe' in job.keys():
|
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")
|
error_msgs.append(f"Invalid job for host {task_vars['ansible_host']} : it needs either a path or a command_to_pipe, not both")
|
||||||
|
|
Reference in a new issue