mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Revert previous workaround for ListTemplateCommand, which is correct
after updating the systemvm.iso on devcloud.
This commit is contained in:
parent
bc244ccc8b
commit
7ad263b67e
@ -20,14 +20,14 @@ import com.cloud.agent.api.to.DataStoreTO;
|
|||||||
|
|
||||||
public class ListTemplateCommand extends StorageCommand {
|
public class ListTemplateCommand extends StorageCommand {
|
||||||
private DataStoreTO store;
|
private DataStoreTO store;
|
||||||
private String secUrl;
|
//private String secUrl;
|
||||||
|
|
||||||
public ListTemplateCommand() {
|
public ListTemplateCommand() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public ListTemplateCommand(DataStoreTO store, String url) {
|
public ListTemplateCommand(DataStoreTO store) {
|
||||||
this.store = store;
|
this.store = store;
|
||||||
this.secUrl = url;
|
// this.secUrl = url;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -40,8 +40,8 @@ public class ListTemplateCommand extends StorageCommand {
|
|||||||
return store;
|
return store;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSecUrl() {
|
// public String getSecUrl() {
|
||||||
return secUrl;
|
// return secUrl;
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1153,7 +1153,7 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S
|
|||||||
DataStoreTO store = cmd.getDataStore();
|
DataStoreTO store = cmd.getDataStore();
|
||||||
if (store instanceof NfsTO) {
|
if (store instanceof NfsTO) {
|
||||||
NfsTO nfs = (NfsTO) store;
|
NfsTO nfs = (NfsTO) store;
|
||||||
String secUrl = cmd.getSecUrl();
|
String secUrl = nfs.getUrl();
|
||||||
String root = getRootDir(secUrl);
|
String root = getRootDir(secUrl);
|
||||||
Map<String, TemplateProp> templateInfos = _dlMgr.gatherTemplateInfo(root);
|
Map<String, TemplateProp> templateInfos = _dlMgr.gatherTemplateInfo(root);
|
||||||
return new ListTemplateAnswer(secUrl, templateInfos);
|
return new ListTemplateAnswer(secUrl, templateInfos);
|
||||||
|
|||||||
@ -33,6 +33,7 @@ import com.cloud.agent.api.SecStorageFirewallCfgCommand;
|
|||||||
import com.cloud.agent.api.SecStorageSetupCommand;
|
import com.cloud.agent.api.SecStorageSetupCommand;
|
||||||
import com.cloud.agent.api.UpdateHostPasswordCommand;
|
import com.cloud.agent.api.UpdateHostPasswordCommand;
|
||||||
import com.cloud.agent.api.storage.DownloadAnswer;
|
import com.cloud.agent.api.storage.DownloadAnswer;
|
||||||
|
import com.cloud.agent.api.storage.ListTemplateCommand;
|
||||||
import com.cloud.agent.api.to.NfsTO;
|
import com.cloud.agent.api.to.NfsTO;
|
||||||
import com.cloud.exception.UnsupportedVersionException;
|
import com.cloud.exception.UnsupportedVersionException;
|
||||||
import com.cloud.hypervisor.Hypervisor.HypervisorType;
|
import com.cloud.hypervisor.Hypervisor.HypervisorType;
|
||||||
@ -135,7 +136,8 @@ public class RequestTest extends TestCase {
|
|||||||
s_logger.info("Testing serializing and deserializing interface TO works as expected");
|
s_logger.info("Testing serializing and deserializing interface TO works as expected");
|
||||||
|
|
||||||
NfsTO nfs = new NfsTO("nfs://192.168.56.10/opt/storage/secondary", DataStoreRole.Image);
|
NfsTO nfs = new NfsTO("nfs://192.168.56.10/opt/storage/secondary", DataStoreRole.Image);
|
||||||
SecStorageSetupCommand cmd = new SecStorageSetupCommand(nfs, "nfs://192.168.56.10/opt/storage/secondary", null);
|
// SecStorageSetupCommand cmd = new SecStorageSetupCommand(nfs, "nfs://192.168.56.10/opt/storage/secondary", null);
|
||||||
|
ListTemplateCommand cmd = new ListTemplateCommand(nfs);
|
||||||
Request sreq = new Request(2, 3, cmd, true);
|
Request sreq = new Request(2, 3, cmd, true);
|
||||||
sreq.setSequence(892403718);
|
sreq.setSequence(892403718);
|
||||||
|
|
||||||
@ -158,6 +160,7 @@ public class RequestTest extends TestCase {
|
|||||||
assert creq != null : "Couldn't get the request back";
|
assert creq != null : "Couldn't get the request back";
|
||||||
|
|
||||||
compareRequest(creq, sreq);
|
compareRequest(creq, sreq);
|
||||||
|
assertEquals("nfs://192.168.56.10/opt/storage/secondary", ((NfsTO)((ListTemplateCommand)creq.getCommand()).getDataStore()).getUrl());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testDownload() {
|
public void testDownload() {
|
||||||
|
|||||||
@ -417,7 +417,7 @@ public class TemplateServiceImpl implements TemplateService {
|
|||||||
|
|
||||||
|
|
||||||
private Map<String, TemplateProp> listTemplate(DataStore ssStore) {
|
private Map<String, TemplateProp> listTemplate(DataStore ssStore) {
|
||||||
ListTemplateCommand cmd = new ListTemplateCommand(ssStore.getTO(), ssStore.getUri());
|
ListTemplateCommand cmd = new ListTemplateCommand(ssStore.getTO());
|
||||||
EndPoint ep = _epSelector.select(ssStore);
|
EndPoint ep = _epSelector.select(ssStore);
|
||||||
Answer answer = ep.sendMessage(cmd);
|
Answer answer = ep.sendMessage(cmd);
|
||||||
if (answer != null && answer.getResult()) {
|
if (answer != null && answer.getResult()) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user