Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/pr/610'
Browse files Browse the repository at this point in the history
* origin/pr/610:
  Better error message if new VM Name starts with dot
  • Loading branch information
marmarek committed Aug 8, 2024
2 parents 0b1de75 + bd023a9 commit d9e98ad
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions qubes/vm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ def validate_name(holder, prop, value):
raise qubes.exc.QubesValueError(
'VM name must be shorter than 32 characters')

if re.match(r"\A[0-9_-].*\Z", value) is not None:
if re.match(r"\A[0-9_.-].*\Z", value) is not None:
if holder is not None and prop is not None:
raise qubes.exc.QubesPropertyValueError(holder, prop, value,
'{} cannot start with hyphen, underscore or numbers'.format(
prop.__name__))
'{} cannot start with hyphen, underscore, dot ' \
'or numbers'.format(prop.__name__))
raise qubes.exc.QubesValueError(
'VM name cannot start with hyphen, underscore or numbers')
'VM name cannot start with hyphen, underscore, dot or numbers')

# this regexp does not contain '+'; if it had it, we should specifically
# disallow 'lost+found' #1440
Expand Down

0 comments on commit d9e98ad

Please sign in to comment.