Commit b0bf397b authored by Fabien Amarger's avatar Fabien Amarger
Browse files

feat(admin_pwd): Display the admin password

parent e4fdd6264aef
Pipeline #88901 canceled with stages
......@@ -191,6 +191,7 @@
source_path = os.path.expanduser(f'~/etc/cubicweb.d/{args.instance_name}/sources')
# The source file has to be modified to include sqlite
driver_regexp = re.compile('db-driver.*')
admin_pass = re.compile('password=(.*)')
with open(source_path, 'r') as f:
content = f.read()
replaced_content = driver_regexp.sub('db-driver=sqlite', content)
......@@ -194,7 +195,7 @@
with open(source_path, 'r') as f:
content = f.read()
replaced_content = driver_regexp.sub('db-driver=sqlite', content)
# FIXME:TODO print auto generated admin pass
admin_pwd = next(admin_pass.finditer(content)).group(1)
with open(source_path, 'w') as f:
f.write(replaced_content)
......@@ -203,3 +204,4 @@
"Congratulation ! You can run your instance with : "
f"`cubicweb-ctl pyramid -D -l info {args.instance_name}`"
)
print(f"(admin password: {admin_pwd} (from {source_path})")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment