Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib
diff options
context:
space:
mode:
Diffstat (limited to 'archinstall/lib')
-rw-r--r--archinstall/lib/general.py4
-rw-r--r--archinstall/lib/installer.py10
-rw-r--r--archinstall/lib/profiles.py4
3 files changed, 14 insertions, 4 deletions
diff --git a/archinstall/lib/general.py b/archinstall/lib/general.py
index 816fa755..7296b943 100644
--- a/archinstall/lib/general.py
+++ b/archinstall/lib/general.py
@@ -89,7 +89,9 @@ class sys_command:
Stolen from archinstall_gui
"""
- def __init__(self, cmd, callback=None, start_callback=None, peak_output=False, environment_vars={}, *args, **kwargs):
+ def __init__(self, cmd, callback=None, start_callback=None, peak_output=False, environment_vars=None, *args, **kwargs):
+ if environment_vars is None:
+ environment_vars = {}
kwargs.setdefault("worker_id", gen_uid())
kwargs.setdefault("emulate", False)
kwargs.setdefault("suppress_errors", False)
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:
diff --git a/archinstall/lib/profiles.py b/archinstall/lib/profiles.py
index 62190cbf..871e6223 100644
--- a/archinstall/lib/profiles.py
+++ b/archinstall/lib/profiles.py
@@ -163,8 +163,10 @@ class Script:
class Profile(Script):
- def __init__(self, installer, path, args={}):
+ def __init__(self, installer, path, args=None):
super(Profile, self).__init__(path, installer)
+ if args is None:
+ args = {}
def __dump__(self, *args, **kwargs):
return {'path': self.path}