Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
slapos
Commits
73a1dfd6
Commit
73a1dfd6
authored
Jun 09, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Zope2 dependency.
Instantiation shall depend on minimal tools, like system administrator would.
parent
11d9eb0e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
setup.py
setup.py
+0
-1
slapos/recipe/erp5/__init__.py
slapos/recipe/erp5/__init__.py
+8
-3
No files found.
setup.py
View file @
73a1dfd6
...
@@ -27,7 +27,6 @@ setup(name=name,
...
@@ -27,7 +27,6 @@ setup(name=name,
include_package_data
=
True
,
include_package_data
=
True
,
install_requires
=
[
install_requires
=
[
'PyXML'
,
# for full blown python interpreter
'PyXML'
,
# for full blown python interpreter
'Zope2'
,
# some recipes like to play with zope
'lxml'
,
# for full blown python interpreter
'lxml'
,
# for full blown python interpreter
'netaddr'
,
# to manipulate on IP addresses
'netaddr'
,
# to manipulate on IP addresses
'setuptools'
,
# namespaces
'setuptools'
,
# namespaces
...
...
slapos/recipe/erp5/__init__.py
View file @
73a1dfd6
...
@@ -34,8 +34,13 @@ import sys
...
@@ -34,8 +34,13 @@ import sys
import
zc.buildout
import
zc.buildout
import
zc.recipe.egg
import
zc.recipe.egg
import
ConfigParser
import
ConfigParser
from
Zope2.utilities.mkzopeinstance
import
write_inituser
# based on Zope2.utilities.mkzopeinstance.write_inituser
def
Zope2InitUser
(
path
,
username
,
password
):
open
(
path
,
'w'
).
write
(
''
)
os
.
chmod
(
path
,
0600
)
open
(
path
,
"w"
).
write
(
'%s:{SHA}%s
\
n
'
%
(
username
,
binascii
.
b2a_base64
(
hashlib
.
sha1
(
password
).
digest
())[:
-
1
]))
class
Recipe
(
BaseSlapRecipe
):
class
Recipe
(
BaseSlapRecipe
):
def
getTemplateFilename
(
self
,
template_name
):
def
getTemplateFilename
(
self
,
template_name
):
...
@@ -455,7 +460,7 @@ class Recipe(BaseSlapRecipe):
...
@@ -455,7 +460,7 @@ class Recipe(BaseSlapRecipe):
password
=
self
.
generatePassword
()
password
=
self
.
generatePassword
()
# XXX Unhardcoded me please
# XXX Unhardcoded me please
user
=
'zope'
user
=
'zope'
write_initu
ser
(
Zope2InitU
ser
(
os
.
path
.
join
(
self
.
erp5_directory
,
"inituser"
),
user
,
password
)
os
.
path
.
join
(
self
.
erp5_directory
,
"inituser"
),
user
,
password
)
self
.
_createDirectory
(
self
.
erp5_directory
)
self
.
_createDirectory
(
self
.
erp5_directory
)
...
@@ -637,7 +642,7 @@ class Recipe(BaseSlapRecipe):
...
@@ -637,7 +642,7 @@ class Recipe(BaseSlapRecipe):
)
)
# configure default Zope2 zcml
# configure default Zope2 zcml
open
(
os
.
path
.
join
(
self
.
erp5_directory
,
'etc'
,
'site.zcml'
),
'w'
).
write
(
open
(
os
.
path
.
join
(
self
.
erp5_directory
,
'etc'
,
'site.zcml'
),
'w'
).
write
(
pkg_resources
.
resource_string
(
'Zope2'
,
'utilities/skel/etc
/site.zcml'
))
pkg_resources
.
resource_string
(
__name__
,
'template
/site.zcml'
))
zope_config
[
'zodb_configuration_string'
]
=
zodb_configuration_string
zope_config
[
'zodb_configuration_string'
]
=
zodb_configuration_string
zope_config
[
'instance'
]
=
self
.
erp5_directory
zope_config
[
'instance'
]
=
self
.
erp5_directory
zope_config
[
'event_log'
]
=
os
.
path
.
join
(
self
.
log_directory
,
zope_config
[
'event_log'
]
=
os
.
path
.
join
(
self
.
log_directory
,
...
...
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