Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds+github@gmail.com>2020-12-06 11:33:28 +0100
committerAnton Hvornum <anton.feeds+github@gmail.com>2020-12-06 11:33:28 +0100
commit0e8aee0b5411565e85857ad338249f7f0e774af9 (patch)
tree5c05988576d6796fe1adc6b3fbe68e085b3268c9 /archinstall/lib
parentd3462aa4833898ae7ba57feb8d5b10a028863b2a (diff)
Added spec as an instance variable to Script()
Diffstat (limited to 'archinstall/lib')
-rw-r--r--archinstall/lib/profiles.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/archinstall/lib/profiles.py b/archinstall/lib/profiles.py
index 0d1c78ee..3e40e1f8 100644
--- a/archinstall/lib/profiles.py
+++ b/archinstall/lib/profiles.py
@@ -73,6 +73,7 @@ class Script():
self.profile = profile
self.installer = installer
self.converted_path = None
+ self.spec = None
self.namespace = os.path.splitext(os.path.basename(self.path))[0]
def localize_path(self, profile_path):
@@ -116,18 +117,18 @@ class Script():
if namespace:
self.namespace = namespace
- spec = importlib.util.spec_from_file_location(self.namespace, self.path)
- imported = importlib.util.module_from_spec(spec)
+ self.spec = importlib.util.spec_from_file_location(self.namespace, self.path)
+ imported = importlib.util.module_from_spec(self.spec)
sys.modules[self.namespace] = imported
return imported
def execute(self):
- if not self.namespace in sys.modules:
+ if not self.namespace in sys.modules or self.spec is None:
self.load_instructions()
__builtins__['installation'] = self.installer # TODO: Replace this with a import archinstall.session instead
- spec.loader.exec_module(sys.modules[self.namespace])
+ self.spec.loader.exec_module(sys.modules[self.namespace])
return True