MCPcopy Create free account
hub / github.com/archlinux/archinstall / parse_arguments

Method parse_arguments

archinstall/lib/models/users.py:183–214  ·  view source on GitHub ↗
(
		cls,
		args: list[UserSerialization],
	)

Source from the content-addressed store, hash-verified

181
182 @classmethod
183 def parse_arguments(
184 cls,
185 args: list[UserSerialization],
186 ) -> list[Self]:
187 users = []
188
189 for entry in args:
190 username = entry.get('username')
191 password: Password | None = None
192 groups = entry.get('groups', [])
193 plaintext = entry.get('!password')
194 enc_password = entry.get('enc_password')
195
196 # DEPRECATED: backwards compatibility
197 if plaintext:
198 password = Password(plaintext=plaintext)
199 elif enc_password:
200 password = Password(enc_password=enc_password)
201
202 if not username or password is None:
203 continue
204
205 user = cls(
206 username=username,
207 password=password,
208 sudo=entry.get('sudo', False) is True,
209 groups=groups,
210 )
211
212 users.append(user)
213
214 return users

Callers 1

from_configMethod · 0.80

Calls 1

PasswordClass · 0.85

Tested by

no test coverage detected