|
@@ -43,7 +43,7 @@ def name2path(name):
|
43
|
43
|
#@return a bool
|
44
|
44
|
#@throws LodelSiteDatasourceInconsistency if inconsistency detected on FS
|
45
|
45
|
def site_exists(name):
|
46
|
|
- paths = name2paths(name)
|
|
46
|
+ paths = name2path(name)
|
47
|
47
|
|
48
|
48
|
if name == Settings.sitename:
|
49
|
49
|
msg = 'Site shortname "%s" is conflicting with the Lodelsites instance name' % name
|
|
@@ -79,7 +79,7 @@ def site_directories_creation(name):
|
79
|
79
|
raise LodelSiteDatasourceError('This site identified by "%s" \
|
80
|
80
|
already exists' % name)
|
81
|
81
|
|
82
|
|
- data_path, ctx_path = name2paths(name)
|
|
82
|
+ data_path, ctx_path = name2path(name)
|
83
|
83
|
#Starting by creating both directories
|
84
|
84
|
#Datadir
|
85
|
85
|
try:
|
|
@@ -118,8 +118,8 @@ lodelsite "%s" : %s' % (d,name, e))
|
118
|
118
|
|
119
|
119
|
|
120
|
120
|
def site_lodelpkg_link_creation(name):
|
121
|
|
- dst_path = os.path.join(name2path(name)[1], lodel)
|
122
|
|
- src_path = LODEL_PKG_PATH
|
|
121
|
+ dst_path = os.path.join(name2path(name)[1], 'lodel')
|
|
122
|
+ src_path = buildconf.LODEL_PKG_PATH
|
123
|
123
|
|
124
|
124
|
try:
|
125
|
125
|
os.symlink(src_path, dst_path)
|
|
@@ -135,7 +135,7 @@ lodelsite "%s" : %s' % (name, e))
|
135
|
135
|
def site_context_init_creation(name):
|
136
|
136
|
directory = name2path(name)[1]
|
137
|
137
|
try:
|
138
|
|
- open('x', os.path.join(directory, '__init__.py')).close()
|
|
138
|
+ open(os.path.join(directory, '__init__.py'), 'w+').close()
|
139
|
139
|
except FileExistsError:
|
140
|
140
|
logger.critical('This should never happen ! We just checked that this \
|
141
|
141
|
directory does not exist. BAILOUT !')
|
|
@@ -210,7 +210,7 @@ def make_confs(sitename, groups, extensions):
|
210
|
210
|
##@brief Deletes all files related to a site
|
211
|
211
|
#@warning can lead to dirty bugs if the site is running...
|
212
|
212
|
def purge(sitename):
|
213
|
|
- for todel in name2paths(sitename):
|
|
213
|
+ for todel in name2path(sitename):
|
214
|
214
|
try:
|
215
|
215
|
shutil.rmtree(todel)
|
216
|
216
|
except Exception as e:
|