Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos-mynij-dev
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mynij
slapos-mynij-dev
Commits
e4ff584b
Commit
e4ff584b
authored
Jul 05, 2013
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into erp5-component
parents
c9beb29b
54ea7e4e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
2 deletions
+24
-2
slapos/recipe/generic_zope/__init__.py
slapos/recipe/generic_zope/__init__.py
+12
-1
slapos/recipe/generic_zope_zeo_client/__init__.py
slapos/recipe/generic_zope_zeo_client/__init__.py
+12
-1
No files found.
slapos/recipe/generic_zope/__init__.py
View file @
e4ff584b
...
...
@@ -35,11 +35,22 @@ _isurl = re.compile('([a-zA-Z0-9+.-]+)://').match
# based on Zope2.utilities.mkzopeinstance.write_inituser
def
Zope2InitUser
(
path
,
username
,
password
):
# Set password only once
# Currently, rely on existence of a simple file:
# Create it the first time, then next time, detect this file and do no-op.
inituser_done_path
=
'%s_done'
%
path
if
os
.
path
.
exists
(
inituser_done_path
):
return
if
os
.
path
.
exists
(
path
):
return
open
(
path
,
'w'
).
write
(
''
)
os
.
chmod
(
path
,
0600
)
open
(
path
,
"w"
).
write
(
'%s:{SHA}%s
\
n
'
%
(
open
(
path
,
'w'
).
write
(
'%s:{SHA}%s
\
n
'
%
(
username
,
binascii
.
b2a_base64
(
hashlib
.
sha1
(
password
).
digest
())[:
-
1
]))
open
(
inituser_done_path
,
'w'
).
write
(
'"inituser" file already created once.'
)
class
Recipe
(
GenericBaseRecipe
):
def
_options
(
self
,
options
):
options
[
'password'
]
=
self
.
generatePassword
()
...
...
slapos/recipe/generic_zope_zeo_client/__init__.py
View file @
e4ff584b
...
...
@@ -35,11 +35,22 @@ _isurl = re.compile('([a-zA-Z0-9+.-]+)://').match
# based on Zope2.utilities.mkzopeinstance.write_inituser
def
Zope2InitUser
(
path
,
username
,
password
):
# Set password only once
# Currently, rely on existence of a simple file:
# Create it the first time, then next time, detect this file and do no-op.
inituser_done_path
=
'%s_done'
%
path
if
os
.
path
.
exists
(
inituser_done_path
):
return
if
os
.
path
.
exists
(
path
):
return
open
(
path
,
'w'
).
write
(
''
)
os
.
chmod
(
path
,
0600
)
open
(
path
,
"w"
).
write
(
'%s:{SHA}%s
\
n
'
%
(
open
(
path
,
'w'
).
write
(
'%s:{SHA}%s
\
n
'
%
(
username
,
binascii
.
b2a_base64
(
hashlib
.
sha1
(
password
).
digest
())[:
-
1
]))
open
(
inituser_done_path
,
'w'
).
write
(
'"inituser" file already created once.'
)
class
Recipe
(
GenericBaseRecipe
):
def
_options
(
self
,
options
):
options
[
'password'
]
=
self
.
generatePassword
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment