From e69398a43c12e0edc63d3cb4180b0e919604d78a Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Fri, 6 Sep 2024 10:52:58 +0200 Subject: [PATCH] Fix use of regex in yamale schema (#830) This will be fixed: :1: SyntaxWarning: invalid escape sequence '\/' :1: SyntaxWarning: invalid escape sequence '\/' :1: SyntaxWarning: invalid escape sequence '\w' :1: SyntaxWarning: invalid escape sequence '\/' :1: SyntaxWarning: invalid escape sequence '\/' :1: SyntaxWarning: invalid escape sequence '\/' :1: SyntaxWarning: invalid escape sequence '\/' Signed-off-by: Christian Berendt --- etc/schema.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/etc/schema.yaml b/etc/schema.yaml index dd3c91d2..60fc8ad4 100644 --- a/etc/schema.yaml +++ b/etc/schema.yaml @@ -5,8 +5,8 @@ images: list(include('image'), min=1) image: enable: bool() format: enum('aki', 'ari', 'ami', 'raw', 'iso', 'vhd', 'vdi', 'qcow2', 'vmdk') - latest_checksum_url: regex('^(http|ftp)s?:\/\/\w+.*', name='valid URL', required=False) - latest_url: regex('^(http|ftp)s?:\/\/\w+.*', name='valid URL', required=False) + latest_checksum_url: regex(r'^(http|ftp)s?:\/\/\w+.*', name='valid URL', required=False) + latest_url: regex(r'^(http|ftp)s?:\/\/\w+.*', name='valid URL', required=False) login: str() meta: include('meta', required=True) min_disk: int(min=0) @@ -42,15 +42,15 @@ meta: --- versions: build_date: any(day(), timestamp()) - checksum: regex('\w+:([a-f0-9]{32}|[a-f0-9]{40}|[a-f0-9]{64}|[a-f0-9]{128})$', name='valid checksum', required=False) - checksums_url: regex('^(http|ftp)s?:\/\/\w+.*', name='valid URL', required=False) + checksum: regex(r'\w+:([a-f0-9]{32}|[a-f0-9]{40}|[a-f0-9]{64}|[a-f0-9]{128})$', name='valid checksum', required=False) + checksums_url: regex(r'^(http|ftp)s?:\/\/\w+.*', name='valid URL', required=False) hidden: bool(required=False) image_description: str(required=False) meta: include('meta', required=False) os_version: str(required=False) - source: regex('^(http|ftp)s?:\/\/\w+.*|^private$', name='valid URL or private', required=False) - url: regex('^(http|ftp)s?:\/\/\w+.*|^(file:|file:///)\w+.*', name='valid URL') - mirror_url: regex('^(http|ftp)s?:\/\/\w+.*|^(file:|file:///)\w+.*', name='valid URL', required=False) + source: regex(r'^(http|ftp)s?:\/\/\w+.*|^private$', name='valid URL or private', required=False) + url: regex(r'^(http|ftp)s?:\/\/\w+.*|^(file:|file:///)\w+.*', name='valid URL') + mirror_url: regex(r'^(http|ftp)s?:\/\/\w+.*|^(file:|file:///)\w+.*', name='valid URL', required=False) version: str() visibility: enum('public', 'private', 'community', 'shared', required=False) - id: regex('^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$', required=False) + id: regex(r'^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$', required=False)