@@ -428,7 +428,14 @@ def run(self, updatehash=False):
428
428
savepkl (op .join (outdir , '_inputs.pklz' ),
429
429
self .inputs .get_traitsfree ())
430
430
431
- cwd = os .getcwd ()
431
+ try :
432
+ cwd = os .getcwd ()
433
+ except OSError :
434
+ # Changing back to cwd is probably not necessary
435
+ # but this makes sure there's somewhere to change to.
436
+ cwd = os .path .split (outdir )[0 ]
437
+ logger .debug ('Current folder does not exist, changing to "%s" instead.' , cwd )
438
+
432
439
os .chdir (outdir )
433
440
try :
434
441
result = self ._run_interface (execute = True )
@@ -1009,8 +1016,8 @@ def inputs(self):
1009
1016
1010
1017
@property
1011
1018
def outputs (self ):
1012
- if self ._interface ._outputs ():
1013
- return Bunch (self ._interface ._outputs ().get ())
1019
+ if self .interface ._outputs ():
1020
+ return Bunch (self .interface ._outputs ().get ())
1014
1021
1015
1022
def _make_nodes (self , cwd = None ):
1016
1023
if cwd is None :
@@ -1030,7 +1037,7 @@ def _make_nodes(self, cwd=None):
1030
1037
base_dir = op .join (cwd , 'mapflow' ),
1031
1038
name = nodename )
1032
1039
node .plugin_args = self .plugin_args
1033
- node ._interface .inputs .trait_set (
1040
+ node .interface .inputs .trait_set (
1034
1041
** deepcopy (self ._interface .inputs .get ()))
1035
1042
node .interface .resource_monitor = self ._interface .resource_monitor
1036
1043
for field in self .iterfield :
@@ -1177,6 +1184,7 @@ def _run_interface(self, execute=True, updatehash=False):
1177
1184
if path .split (op .sep )[- 1 ] not in nodenames :
1178
1185
dirs2remove .append (path )
1179
1186
for path in dirs2remove :
1187
+ logger .debug ('[MapNode] Removing folder "%s".' , path )
1180
1188
shutil .rmtree (path )
1181
1189
1182
1190
return result
0 commit comments