Skip to content

Commit 8ead0c2

Browse files
committed
Merge pull request #420 from magixyu/master
Bug fix for the get_files. The key should be the file name.
2 parents 69523ca + 6d8c7db commit 8ead0c2

File tree

1 file changed

+7
-4
lines changed
  • core/src/main/java/org/openstack4j/openstack/heat/utils

1 file changed

+7
-4
lines changed

core/src/main/java/org/openstack4j/openstack/heat/utils/Template.java

100755100644
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ private void resolveTemplateGetFiles(Map<?,?> map) throws IOException {
105105

106106
if(isGetFile(skey)) {
107107
//if key="get_file", the value is the filename
108-
String fileFullPath = baseUrl + (String)value;
109-
addToFiles(fileFullPath);
108+
addToFiles((String)value);
110109
continue;
111110
}
112111

@@ -122,10 +121,14 @@ private void resolveTemplateGetFiles(Map<?,?> map) throws IOException {
122121
}
123122
}
124123
}
125-
124+
126125
private void addToFiles(String filename) throws IOException {
127126
if(! files.containsKey(filename)) {
128-
files.put(filename, TemplateUtils.readToString(filename));
127+
if (filename.startsWith("/")){
128+
files.put(filename, TemplateUtils.readToString(filename));
129+
} else {
130+
files.put(filename, TemplateUtils.readToString(baseUrl + filename));
131+
}
129132
}
130133
}
131134

0 commit comments

Comments
 (0)