Commit 86732927 authored by Matthias's avatar Matthias
Browse files

adapt to sftp-structure

parent ef155f59
Pipeline #32999 passed with stages
in 2 minutes and 9 seconds
...@@ -63,14 +63,14 @@ class FetchMappingFile(Resource): ...@@ -63,14 +63,14 @@ class FetchMappingFile(Resource):
sftp_client = ssh_client.open_sftp() sftp_client = ssh_client.open_sftp()
for fileName in ['mapping.yml', 'transform.xslt', 'localTransforms.yml']: for fileName in ['mapping.yml', 'transform.xslt', 'localTransforms.yml']:
configDirectory = 'config' envDir = '/'
if current_app.config['env'] == 'stage': if current_app.config['env'] == 'stage':
configDirectory = 'config-stage' envDir = '/stage/'
elif current_app.config['env'] == 'test': elif current_app.config['env'] == 'test':
configDirectory = 'config-test' envDir = '/test/'
remote_path = '/swissbib_index/mb_sftp/' + recordset_id +\ remote_path = '/swissbib_index/mb_sftp' + envDir + recordset_id +\
'/' + configDirectory + '/' + fileName '/config/' + fileName
try: try:
sftp_client.stat(remote_path) sftp_client.stat(remote_path)
remote_file = sftp_client.file(remote_path, 'r') remote_file = sftp_client.file(remote_path, 'r')
......
Supports Markdown
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