Skip to content

Commit

Permalink
Merge pull request #909 from MissionCriticalCloud/fix/template-downlo…
Browse files Browse the repository at this point in the history
…ads-new-secstorvm

Fix/template downloads new secstorvm
  • Loading branch information
Alexander authored Nov 3, 2020
2 parents cbc96a4 + 37cc201 commit 7f1c2f1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ protected Answer copySnapshotToTemplateFromNfsToNfs(final CopyCommand cmd, final
) {
// KVM didn't change template unique name, just used the template name passed from orchestration layer, so no need
// to send template name back.
bufferWriter.write("uniquename=" + destData.getName());
bufferWriter.write("uniquename=" + destData.getUniqueName());
bufferWriter.write("\n");
bufferWriter.write("filename=" + fileName);
bufferWriter.write("\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,12 +404,12 @@ public DataTO getTO() {
}
if (dataStore == null) {
to = new TemplateObjectTO(this.getInstallPath(), this.getUrl(), this.getUuid(), this.getId(), this.getFormat(), this.getAccountId(), this.getChecksum(), this.getDisplayText(),
dataStoreTO, this.getName(), null, null, null, this.getHypervisorType());
dataStoreTO, this.getName(), this.getUniqueName(), null, null, null, this.getHypervisorType());
} else {
to = dataStore.getDriver().getTO(this);
if (to == null) {
to = new TemplateObjectTO(this.getInstallPath(), this.getUrl(), this.getUuid(), this.getId(), this.getFormat(), this.getAccountId(), this.getChecksum(), this.getDisplayText(),
dataStoreTO, this.getName(), null, null, null, this.getHypervisorType());
dataStoreTO, this.getName(), this.getUniqueName(), null, null, null, this.getHypervisorType());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public DownloadCommand(final TemplateObjectTO template, final String user, final

public DownloadCommand(final TemplateObjectTO template, final Long maxDownloadSizeInBytes) {

super(template.getName(), template.getOrigUrl(), template.getFormat(), template.getAccountId());
super(template.getUniqueName(), template.getOrigUrl(), template.getFormat(), template.getAccountId());
_store = template.getDataStore();
installPath = template.getPath();
checksum = template.getChecksum();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class TemplateObjectTO implements DataTO {
private String displayText;
private DataStoreTO imageDataStore;
private String name;
private String uniqueName;
private String guestOsType;
private Long size;
private Long physicalSize;
Expand All @@ -25,7 +26,7 @@ public TemplateObjectTO() {
}

public TemplateObjectTO(final String path, final String origUrl, final String uuid, final long id, final ImageFormat format, final long accountId, final String checksum, final String
displayText, final DataStoreTO imageDataStore, final String name, final String guestOsType, final Long size, final Long physicalSize, final HypervisorType hypervisorType) {
displayText, final DataStoreTO imageDataStore, final String name, final String uniqueName, final String guestOsType, final Long size, final Long physicalSize, final HypervisorType hypervisorType) {
this.path = path;
this.origUrl = origUrl;
this.uuid = uuid;
Expand All @@ -36,6 +37,7 @@ public TemplateObjectTO(final String path, final String origUrl, final String uu
this.displayText = displayText;
this.imageDataStore = imageDataStore;
this.name = name;
this.uniqueName = uniqueName;
this.guestOsType = guestOsType;
this.size = size;
this.physicalSize = physicalSize;
Expand Down Expand Up @@ -130,10 +132,18 @@ public String getName() {
return name;
}

public String getUniqueName() {
return uniqueName;
}

public void setName(final String name) {
this.name = name;
}

public void setUniqueName(final String uniqueName) {
this.uniqueName = uniqueName;
}

public String getOrigUrl() {
return origUrl;
}
Expand Down

0 comments on commit 7f1c2f1

Please sign in to comment.