Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Matthias
my-test-project-1
Commits
ef155f59
Commit
ef155f59
authored
Jun 15, 2021
by
Matthias
Browse files
distinguish config-directory depending on environment
parent
76da8caf
Pipeline
#32997
passed with stages
in 2 minutes and 3 seconds
Changes
1
Pipelines
2
Show whitespace changes
Inline
Side-by-side
import_api_app/resources/FetchMappingFile.py
View file @
ef155f59
...
...
@@ -63,7 +63,14 @@ class FetchMappingFile(Resource):
sftp_client
=
ssh_client
.
open_sftp
()
for
fileName
in
[
'mapping.yml'
,
'transform.xslt'
,
'localTransforms.yml'
]:
remote_path
=
'/swissbib_index/mb_sftp/'
+
recordset_id
+
'/config/'
+
fileName
configDirectory
=
'config'
if
current_app
.
config
[
'env'
]
==
'stage'
:
configDirectory
=
'config-stage'
elif
current_app
.
config
[
'env'
]
==
'test'
:
configDirectory
=
'config-test'
remote_path
=
'/swissbib_index/mb_sftp/'
+
recordset_id
+
\
'/'
+
configDirectory
+
'/'
+
fileName
try
:
sftp_client
.
stat
(
remote_path
)
remote_file
=
sftp_client
.
file
(
remote_path
,
'r'
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment