Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OWL2YAMS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cubicweb
OWL2YAMS
Commits
b0bf397b8847
Commit
b0bf397b8847
authored
3 years ago
by
Fabien Amarger
Browse files
Options
Downloads
Patches
Plain Diff
feat(admin_pwd): Display the admin password
parent
e4fdd6264aef
No related branches found
No related tags found
No related merge requests found
Pipeline
#88901
canceled
3 years ago
Stage: lint
Stage: tests
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
owl2yams/__init__.py
+3
-1
3 additions, 1 deletion
owl2yams/__init__.py
with
3 additions
and
1 deletion
owl2yams/__init__.py
+
3
−
1
View file @
b0bf397b
...
...
@@ -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
}
)
"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment