Skip to content
Snippets Groups Projects
Commit 50ce6c5c authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Go back to cwd after running a legacy parser.

parent 2bbada57
No related branches found
No related tags found
1 merge request!39Migration
...@@ -69,7 +69,8 @@ fs = NomadConfig( ...@@ -69,7 +69,8 @@ fs = NomadConfig(
public='.volumes/fs/public', public='.volumes/fs/public',
migration_packages='.volumes/fs/migration_packages', migration_packages='.volumes/fs/migration_packages',
local_tmp='/tmp', local_tmp='/tmp',
prefix_size=2 prefix_size=2,
working_directory=os.getcwd()
) )
elastic = NomadConfig( elastic = NomadConfig(
......
...@@ -21,9 +21,10 @@ import inspect ...@@ -21,9 +21,10 @@ import inspect
from unittest.mock import patch from unittest.mock import patch
import logging import logging
import os.path import os.path
import os
import glob import glob
from nomad import utils from nomad import utils, config
from nomad.parsing.backend import LocalBackend from nomad.parsing.backend import LocalBackend
...@@ -132,6 +133,7 @@ class LegacyParser(Parser): ...@@ -132,6 +133,7 @@ class LegacyParser(Parser):
with patch.object(sys, 'argv', []): with patch.object(sys, 'argv', []):
backend = self.parser.parse(mainfile) backend = self.parser.parse(mainfile)
os.chdir(config.fs.working_directory)
if backend is None or not hasattr(backend, 'status'): if backend is None or not hasattr(backend, 'status'):
backend = self.parser.parser_context.super_backend backend = self.parser.parser_context.super_backend
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment