Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better error message if new VM Name starts with dot #610

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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