Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-03-21 15:13:08 +0100
committerAnton Hvornum <anton@hvornum.se>2021-03-21 15:13:08 +0100
commita9f177e722d80ecbacb0c8e74ea0e8a4b88212be (patch)
tree4e5242ba03612e7e374d4631253176eb28cce31a /archinstall
parent28606cde6127921615692460bbb4d80f68b7b727 (diff)
Reverted reset_namespace idea. Didn't turn out as clean as I wanted it to.
Diffstat (limited to 'archinstall')
-rw-r--r--archinstall/lib/profiles.py12
1 files changed, 2 insertions, 10 deletions
diff --git a/archinstall/lib/profiles.py b/archinstall/lib/profiles.py
index 8284bf40..a0f2dc77 100644
--- a/archinstall/lib/profiles.py
+++ b/archinstall/lib/profiles.py
@@ -125,9 +125,7 @@ class Script():
else:
raise ProfileNotFound(f"Cannot handle scheme {parsed_url.scheme}")
- def load_instructions(self, namespace=None, reset_namespace=False):
- original_namespace = self.namespace
-
+ def load_instructions(self, namespace=None):
if namespace:
self.namespace = namespace
@@ -137,12 +135,6 @@ class Script():
print(f"Imported {self} into sys.modules with namespace {self.namespace}")
- if '.py' not in self.namespace:
- raise KeyError(f"Debugging: {self.namespace}, {reset_namespace}, {self}")
-
- if reset_namespace:
- self.namespace = original_namespace
-
return self
def execute(self):
@@ -181,7 +173,7 @@ class Profile(Script):
# if __name__ == 'moduleName'
if '__name__' in source_data and '_prep_function' in source_data:
print(f"Checking if {self} has _prep_function by importing with namespace {self.namespace}.py")
- with self.load_instructions(namespace=f"{self.namespace}.py", reset_namespace=True) as imported:
+ with self.load_instructions(namespace=f"{self.namespace}.py") as imported:
if hasattr(imported, '_prep_function'):
return True
return False