Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/installer.py
diff options
context:
space:
mode:
authorDylan Taylor <dylan@dylanmtaylor.com>2021-05-15 15:24:34 -0400
committerDylan Taylor <dylan@dylanmtaylor.com>2021-05-15 15:24:34 -0400
commit96a48664e2d69d138f58967fdd75c605ad21478e (patch)
tree0429b25ba97ea4457b1a1f52b0875859509696b8 /archinstall/lib/installer.py
parentf7642786c9e169245fae52d8754b9d68f2507cb7 (diff)
Fix mutable default arguments
https://docs.python-guide.org/writing/gotchas/#mutable-default-arguments
Diffstat (limited to 'archinstall/lib/installer.py')
-rw-r--r--archinstall/lib/installer.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
index cdf69273..9ddb8825 100644
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -34,7 +34,11 @@ class Installer:
"""
- def __init__(self, target, *, base_packages=__packages__[:3], kernels=['linux']):
+ def __init__(self, target, *, base_packages=None, kernels=None):
+ if base_packages is None:
+ base_packages = __packages__[:3]
+ if kernels is None:
+ kernels = ['linux']
self.target = target
self.init_time = time.strftime('%Y-%m-%d_%H-%M-%S')
self.milliseconds = int(str(time.time()).split('.')[1])
@@ -476,7 +480,9 @@ class Installer:
sudoers.write(f'{"%" if group else ""}{entity} ALL=(ALL) ALL\n')
return True
- def user_create(self, user: str, password=None, groups=[], sudo=False):
+ def user_create(self, user: str, password=None, groups=None, sudo=False):
+ if groups is None:
+ groups = []
self.log(f'Creating user {user}', level=logging.INFO)
o = b''.join(sys_command(f'/usr/bin/arch-chroot {self.target} useradd -m -G wheel {user}'))
if password: