simulator: fix travis failure after merging volume destroy/recover (#3880)

* test: do not associate public ip in test while deploy vm

* simulator: remove template/volume only if it exist

* simulator: fix build error
This commit is contained in:
Wei Zhou 2020-02-13 05:28:31 +01:00 committed by GitHub
parent d46f428757
commit e5efb59414
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 8 deletions

View File

@ -40,7 +40,6 @@ import org.apache.cloudstack.storage.command.DownloadProgressCommand;
import org.apache.cloudstack.storage.command.UploadStatusAnswer;
import org.apache.cloudstack.storage.command.UploadStatusAnswer.UploadStatus;
import org.apache.cloudstack.storage.command.UploadStatusCommand;
import org.apache.cloudstack.storage.to.VolumeObjectTO;
import com.cloud.agent.api.Answer;
import com.cloud.agent.api.AttachIsoCommand;
@ -823,12 +822,7 @@ public class MockStorageManagerImpl extends ManagerBase implements MockStorageMa
try {
txn.start();
MockVolumeVO template = _mockVolumeDao.findByStoragePathAndType(cmd.getData().getPath());
if (template == null) {
if(!((VolumeObjectTO)cmd.getData()).getName().startsWith("ROOT-")) {
return new Answer(cmd, false, "can't find object to delete:" + cmd.getData()
.getPath());
}
} else {
if (template != null) {
_mockVolumeDao.remove(template.getId());
}
txn.commit();

View File

@ -803,7 +803,6 @@ class TestVMLifeCycle(cloudstackTestCase):
accountid=self.account.name,
domainid=self.account.domainid,
serviceofferingid=self.small_offering.id,
mode=self.services["mode"]
)
vol1 = Volume.create(
self.apiclient,