mirror of https://github.com/apache/cloudstack.git
utils: Allow IMG extension for QCOW2 format (#4013)
Attempts to register QCOW2 template with .img extension fails fast. This fix allows registering a QCOW2 template with .img extension
This commit is contained in:
parent
220448aa94
commit
b8ceb88ed9
|
|
@ -512,7 +512,7 @@ public class UriUtils {
|
|||
ImmutableMap.<String, Set<String>>builder()
|
||||
.put("vhd", buildExtensionSet(false, "vhd"))
|
||||
.put("vhdx", buildExtensionSet(false, "vhdx"))
|
||||
.put("qcow2", buildExtensionSet(true, "qcow2"))
|
||||
.put("qcow2", buildExtensionSet(true, "qcow2", "img"))
|
||||
.put("ova", buildExtensionSet(true, "ova"))
|
||||
.put("tar", buildExtensionSet(false, "tar"))
|
||||
.put("raw", buildExtensionSet(false, "img", "raw"))
|
||||
|
|
|
|||
|
|
@ -102,7 +102,10 @@ public class UriUtilsParametrizedTest {
|
|||
final String realFormat = format;
|
||||
|
||||
for (String extension : FORMATS) {
|
||||
final boolean expectSuccess = format.equals(extension.replace("img", "raw"));
|
||||
boolean expectSuccess = format.equals(extension.replace("img", "raw"));
|
||||
if (format.equals("qcow2") && extension.equals("img")) {
|
||||
expectSuccess = true;
|
||||
}
|
||||
|
||||
for (String commpressionFormat : COMMPRESSION_FORMATS) {
|
||||
final String url = validBaseUri + extension + commpressionFormat;
|
||||
|
|
|
|||
Loading…
Reference in New Issue