Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/profiles.py
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-03-21 15:00:08 +0100
committerAnton Hvornum <anton@hvornum.se>2021-03-21 15:00:08 +0100
commit27bde44b8de447e8612a83bc6964fc1b5237e07d (patch)
tree91ed10ff1233161326f2483db474237f58a57dd7 /archinstall/lib/profiles.py
parentc99abb1a7b6b0fe75f8bc1b7558e0e13afb283c5 (diff)
Debugging tainted namespace on profile modules.
Diffstat (limited to 'archinstall/lib/profiles.py')
-rw-r--r--archinstall/lib/profiles.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/archinstall/lib/profiles.py b/archinstall/lib/profiles.py
index 724b92e7..5d425a22 100644
--- a/archinstall/lib/profiles.py
+++ b/archinstall/lib/profiles.py
@@ -126,17 +126,15 @@ class Script():
raise ProfileNotFound(f"Cannot handle scheme {parsed_url.scheme}")
def load_instructions(self, namespace=None):
- if not namespace:
- namespace = self.namespace
+ if namespace:
+ self.namespace = namespace
- self.spec = importlib.util.spec_from_file_location(namespace, self.path)
+ self.spec = importlib.util.spec_from_file_location(self.namespace, self.path)
imported = importlib.util.module_from_spec(self.spec)
- sys.modules[namespace] = imported
+ sys.modules[self.namespace] = imported
- print(f"Imported {self} into sys.modules with namespace {namespace}.")
+ print(f"Imported {self} into sys.modules with namespace {self.namespace}.")
- if '.py' not in namespace:
- raise KeyError("Debugging")
return self
def execute(self):