Commit f69cc7d2 authored by Arnaud Fontaine's avatar Arnaud Fontaine

ZODB Components: Migration dialog: Make sure that paths given in Working Copy...

ZODB Components: Migration dialog: Make sure that paths given in Working Copy (Preference) are valid.
parent d2f87fd8
......@@ -6401,11 +6401,21 @@ Business Template is a set of definitions, such as skins, portal types and categ
return
def _getWorkingCopyPathList(self):
working_copy_list = self.getPortalObject().portal_preferences.getPreferredWorkingCopyList([])
if not working_copy_list:
raise RuntimeError("No 'Working Copies' set in Preferences")
preference_tool = self.getPortalObject().portal_preferences
working_copy_path_list = []
for p in preference_tool.getPreferredWorkingCopyList([]):
path = os.path.realpath(p)
if os.path.isdir(path):
working_copy_path_list.append(path)
else:
LOG('BusinessTemplate', WARNING,
"%s: Invalid Preferences Working Copy (realpath=%s)" % (p, path))
if not working_copy_path_list:
raise RuntimeError("No 'Working Copies' set in Preferences or "
"non-existent directory")
return [ os.path.realpath(p) for p in working_copy_list ]
return working_copy_path_list
def _checkFilesystemModulePath(self,
module_obj,
......
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