Skip to content

Commit 377e95a

Browse files
committed
Fix RegEx to parse cname as platform_element correctly
Signed-off-by: Tobias Wolf <[email protected]>
1 parent 4b57caf commit 377e95a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/gardenlinux/features/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def main():
4949

5050
if args.cname:
5151
re_match = re.match(
52-
"([a-zA-Z0-9]+(-[a-zA-Z0-9\\_\\-]*?)?)(-([a-z0-9]+)(-([a-z0-9.]+)-([a-z0-9]+))*)?$",
52+
"([a-zA-Z0-9]+([\\_\\-][a-zA-Z0-9]+)+?)(-([a-z0-9]+)(-([a-z0-9.]+)-([a-z0-9]+))*)?$",
5353
args.cname
5454
)
5555

src/gardenlinux/features/cname_main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def main():
2121
args = parser.parse_args()
2222

2323
re_match = re.match(
24-
"([a-zA-Z0-9]+(-[a-zA-Z0-9\\_\\-]*?)?)(-([a-z0-9]+)(-([a-z0-9.]+)-([a-z0-9]+))*)?$",
24+
"([a-zA-Z0-9]+([\\_\\-][a-zA-Z0-9]+)+?)(-([a-z0-9]+)(-([a-z0-9.]+)-([a-z0-9]+))*)?$",
2525
args.cname
2626
)
2727

0 commit comments

Comments
 (0)