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-11-08 23:22:26 +0000
committerAnton Hvornum <anton.feeds+github@gmail.com>2020-11-08 23:22:26 +0000
commitdecf9119f27cba6a5aa3ae33b7c3e73d2f869af9 (patch)
treeb7707ca11e1668dd24bbb37cf626fbb5e7c91382 /archinstall/lib
parent18c811ac967110d9371cc5dcdcd44382b25b0494 (diff)
Fixing a variable missmatch in #61. The global configuration snapshot (that is used for debug printing) does not contain the password for the new user (for safety reasons). So we can no longer get the password from that snapshot, but instead we have to get it from the global variable users (:dict).
Diffstat (limited to 'archinstall/lib')
-rw-r--r--archinstall/lib/profiles.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/archinstall/lib/profiles.py b/archinstall/lib/profiles.py
index f20726d2..e9eb9583 100644
--- a/archinstall/lib/profiles.py
+++ b/archinstall/lib/profiles.py
@@ -49,7 +49,10 @@ def find_examples():
:return: {'guided.py' : './examples/guided.py', '<profile #2>' : '<path #2>'}
:rtype: dict
"""
- cwd = os.path.abspath(f'{os.path.dirname(__file__)}')
+
+ # We need to traverse backwards one step with /../ because
+ # We're living in src/lib/ and we're not executing from src/ anymore.
+ cwd = os.path.abspath(f'{os.path.dirname(__file__)}/../')
examples = f"{cwd}/examples"
return {os.path.basename(path): path for path in glob.glob(f'{examples}/*.py')}
@@ -65,7 +68,9 @@ def find_installation_script(profile):
with open(profile, 'r') as file:
return Script(file.read(), filename=os.path.basename(profile))
except FileNotFoundError:
- cwd = os.path.abspath(f'{os.path.dirname(__file__)}')
+ # We need to traverse backwards one step with /../ because
+ # We're living in src/lib/ and we're not executing from src/ anymore.
+ cwd = os.path.abspath(f'{os.path.dirname(__file__)}/../')
examples = f"{cwd}/examples"
raise ProfileNotFound(f"File {profile} does not exist in {examples}")
elif parsed_url.scheme in ('https', 'http'):