Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
7c9c2e1f
Commit
7c9c2e1f
authored
Jun 16, 2011
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove setSoftwareHome (commented)
parent
0e51f6d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
33 deletions
+33
-33
product/ERP5/Tool/IntrospectionTool.py
product/ERP5/Tool/IntrospectionTool.py
+33
-33
No files found.
product/ERP5/Tool/IntrospectionTool.py
View file @
7c9c2e1f
...
...
@@ -296,45 +296,45 @@ class IntrospectionTool(LogMixin, BaseTool):
"""
return
getConfiguration
().
softwarehome
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'setSoftwareHome'
)
def
setSoftwareHome
(
self
,
relative_path
):
"""
EXPERIMENTAL - DEVELOPMENT
#
security.declareProtected(Permissions.ManagePortal, 'setSoftwareHome')
#
def setSoftwareHome(self, relative_path):
#
"""
#
EXPERIMENTAL - DEVELOPMENT
Set the value of SOFTWARE_HOME for zopectl startup script
or from zope.conf (whichever is most relevant)
#
Set the value of SOFTWARE_HOME for zopectl startup script
#
or from zope.conf (whichever is most relevant)
Rationale: multiple versions of ERP5 / Zope can be present
at the same time on the same system
#
Rationale: multiple versions of ERP5 / Zope can be present
#
at the same time on the same system
WARNING: the list of possible path should be protected
if possible (ex. /etc/erp5/software_home)
"""
config
=
self
.
_loadExternalConfig
()
allowed_path_list
=
config
.
get
(
"main"
,
"zopehome"
).
split
(
"
\
n
"
)
base_zope_path
=
config
.
get
(
"base"
,
"base_zope_path"
).
split
(
"
\
n
"
)
path
=
"%s/%s/lib/python"
%
(
base_zope_path
,
relative_path
)
if
path
not
in
allowed_path_list
:
raise
Unauthorized
(
"You are setting one Unauthorized path as Zope Home."
)
#
WARNING: the list of possible path should be protected
#
if possible (ex. /etc/erp5/software_home)
#
"""
#
config = self._loadExternalConfig()
#
allowed_path_list = config.get("main", "zopehome").split("\n")
#
base_zope_path = config.get("base", "base_zope_path").split("\n")
#
path = "%s/%s/lib/python" % (base_zope_path,relative_path)
#
#
if path not in allowed_path_list:
#
raise Unauthorized("You are setting one Unauthorized path as Zope Home.")
config_file
=
self
.
_getZopeConfigurationFile
(
"bin/zopectl"
)
new_file_list
=
[]
for
line
in
config_file
:
if
line
.
startswith
(
"SOFTWARE_HOME="
):
# Only comment the line, so it can easily reverted
new_file_list
.
append
(
"#%s"
%
(
line
))
new_file_list
.
append
(
'SOFTWARE_HOME="%s"
\
n
'
%
(
path
))
else
:
new_file_list
.
append
(
line
)
#
config_file = self._getZopeConfigurationFile("bin/zopectl")
#
new_file_list = []
#
for line in config_file:
#
if line.startswith("SOFTWARE_HOME="):
#
# Only comment the line, so it can easily reverted
#
new_file_list.append("#%s" % (line))
#
new_file_list.append('SOFTWARE_HOME="%s"\n' % (path))
#
else:
#
new_file_list.append(line)
config_file
.
close
()
#
config_file.close()
# reopen file for write
config_file
=
self
.
_getZopeConfigurationFile
(
"bin/zopectl"
,
"w"
)
config_file
.
write
(
""
.
join
(
new_file_list
))
config_file
.
close
()
return
#
# reopen file for write
#
config_file = self._getZopeConfigurationFile("bin/zopectl", "w")
#
config_file.write("".join(new_file_list))
#
config_file.close()
#
return
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'getPythonExecutable'
)
def
getPythonExecutable
(
self
):
...
...
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