Skip to content

Commit 9284408

Browse files
committed
Merge branch 'containers' into develop
2 parents 71ecb1d + 4c956d2 commit 9284408

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

api/src/main/resources/plugins/base_creator.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,16 @@ def _instantiate_properties(self, application_name, user_name, component, proper
181181
return props
182182

183183
def _fill_properties(self, local_file, props):
184-
with open(local_file, "r") as myfile:
185-
file_contents = myfile.read()
186-
187-
new_file_contents = string.Template(
188-
file_contents).safe_substitute(props)
184+
try:
185+
with open(local_file, "r") as myfile:
186+
file_contents = myfile.read()
187+
new_file_contents = string.Template(file_contents).safe_substitute(props)
188+
with open(local_file, "w") as myfile:
189+
myfile.write(new_file_contents)
190+
except UnicodeDecodeError:
191+
# for binary files do not substitute
192+
pass
189193

190-
with open(local_file, "w") as myfile:
191-
myfile.write(new_file_contents)
192194

193195
def _auto_fill_app_properties(self, staged_component_path, props):
194196
app_properties_file_path = '%s/application.properties' % staged_component_path

0 commit comments

Comments
 (0)