Fixed root_password and users[superuser=True] check (#3312)
This commit is contained in:
parent
1fbb21f38a
commit
f0159e1278
|
|
@ -223,7 +223,7 @@ class GlobalMenu(AbstractMenu):
|
||||||
return item.has_value()
|
return item.has_value()
|
||||||
|
|
||||||
def has_superuser() -> bool:
|
def has_superuser() -> bool:
|
||||||
item = self._item_group.find_by_key('!users')
|
item = self._item_group.find_by_key('users')
|
||||||
|
|
||||||
if item.has_value():
|
if item.has_value():
|
||||||
users = item.value
|
users = item.value
|
||||||
|
|
@ -234,8 +234,8 @@ class GlobalMenu(AbstractMenu):
|
||||||
missing = set()
|
missing = set()
|
||||||
|
|
||||||
for item in self._item_group.items:
|
for item in self._item_group.items:
|
||||||
if item.key in ['!root-password', '!users']:
|
if item.key in ['root_password', 'users']:
|
||||||
if not check('!root-password') and not has_superuser():
|
if not check('root_password') and not has_superuser():
|
||||||
missing.add(
|
missing.add(
|
||||||
str(_('Either root-password or at least 1 user with sudo privileges must be specified'))
|
str(_('Either root-password or at least 1 user with sudo privileges must be specified'))
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue