Fixed root_password and users[superuser=True] check (#3312)

This commit is contained in:
Anton Hvornum 2025-03-30 21:06:42 +02:00 committed by GitHub
parent 1fbb21f38a
commit f0159e1278
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -223,7 +223,7 @@ class GlobalMenu(AbstractMenu):
return item.has_value()
def has_superuser() -> bool:
item = self._item_group.find_by_key('!users')
item = self._item_group.find_by_key('users')
if item.has_value():
users = item.value
@ -234,8 +234,8 @@ class GlobalMenu(AbstractMenu):
missing = set()
for item in self._item_group.items:
if item.key in ['!root-password', '!users']:
if not check('!root-password') and not has_superuser():
if item.key in ['root_password', 'users']:
if not check('root_password') and not has_superuser():
missing.add(
str(_('Either root-password or at least 1 user with sudo privileges must be specified'))
)