Updated Branches: refs/heads/object_store 1a74dfaa2 -> 1fe5d7c88
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1fe5d7c8/engine/storage/src/org/apache/cloudstack/storage/to/VolumeObjectTO.java ---------------------------------------------------------------------- diff --git a/engine/storage/src/org/apache/cloudstack/storage/to/VolumeObjectTO.java b/engine/storage/src/org/apache/cloudstack/storage/to/VolumeObjectTO.java deleted file mode 100644 index e556a3b..0000000 --- a/engine/storage/src/org/apache/cloudstack/storage/to/VolumeObjectTO.java +++ /dev/null @@ -1,83 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -package org.apache.cloudstack.storage.to; - -import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectType; -import org.apache.cloudstack.engine.subsystem.api.storage.DataTO; -import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreInfo; -import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo; -import org.apache.cloudstack.engine.subsystem.api.storage.disktype.DiskFormat; -import org.apache.cloudstack.engine.subsystem.api.storage.type.VolumeType; - -public class VolumeObjectTO implements DataTO { - private final String uuid; - private final String path; - private VolumeType volumeType; - private DiskFormat diskType; - private PrimaryDataStoreTO dataStore; - private String name; - private final long size; - public VolumeObjectTO(VolumeInfo volume) { - this.uuid = volume.getUuid(); - this.path = volume.getUri(); - //this.volumeType = volume.getType(); - //this.diskType = volume.getDiskType(); - if (volume.getDataStore() != null) { - this.dataStore = new PrimaryDataStoreTO((PrimaryDataStoreInfo)volume.getDataStore()); - } else { - this.dataStore = null; - } - //this.name = volume.getName(); - this.size = volume.getSize(); - } - - public String getUuid() { - return this.uuid; - } - - public String getPath() { - return this.path; - } - - public VolumeType getVolumeType() { - return this.volumeType; - } - - public DiskFormat getDiskType() { - return this.diskType; - } - - public PrimaryDataStoreTO getDataStore() { - return this.dataStore; - } - - public void setDataStore(PrimaryDataStoreTO dataStore) { - this.dataStore = dataStore; - } - - public String getName() { - return this.name; - } - - public long getSize() { - return this.size; - } - - public DataObjectType getObjectType() { - return DataObjectType.VOLUME; - } -} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1fe5d7c8/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XcpOssResource.java ---------------------------------------------------------------------- diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XcpOssResource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XcpOssResource.java index 357b433..e5a9559 100644 --- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XcpOssResource.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XcpOssResource.java @@ -20,7 +20,6 @@ package com.cloud.hypervisor.xen.resource; import java.io.File; import java.util.ArrayList; import java.util.List; -import java.util.Map; import java.util.Set; import javax.ejb.Local; @@ -46,10 +45,10 @@ import com.cloud.utils.script.Script; import com.cloud.vm.VirtualMachine; import com.xensource.xenapi.Connection; import com.xensource.xenapi.Types; +import com.xensource.xenapi.Types.XenAPIException; import com.xensource.xenapi.VBD; import com.xensource.xenapi.VDI; import com.xensource.xenapi.VM; -import com.xensource.xenapi.Types.XenAPIException; @Local(value=ServerResource.class) public class XcpOssResource extends CitrixResourceBase { http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1fe5d7c8/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerStorageResource.java ---------------------------------------------------------------------- diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerStorageResource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerStorageResource.java index 1cd5335..e7c009b 100644 --- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerStorageResource.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerStorageResource.java @@ -39,10 +39,8 @@ import org.apache.cloudstack.storage.command.CopyCmdAnswer; import org.apache.cloudstack.storage.command.CreateObjectAnswer; import org.apache.cloudstack.storage.command.CreateObjectCommand; import org.apache.cloudstack.storage.command.CreatePrimaryDataStoreCmd; -import org.apache.cloudstack.storage.command.CreateVolumeFromBaseImageCommand; import org.apache.cloudstack.storage.command.StorageSubSystemCommand; import org.apache.cloudstack.storage.datastore.protocol.DataStoreProtocol; -import org.apache.cloudstack.storage.to.ImageOnPrimayDataStoreTO; import org.apache.cloudstack.storage.to.ImageStoreTO; import org.apache.cloudstack.storage.to.PrimaryDataStoreTO; import org.apache.cloudstack.storage.to.TemplateObjectTO; @@ -59,7 +57,6 @@ import com.cloud.agent.api.Answer; import com.cloud.agent.api.Command; import com.cloud.agent.api.storage.DeleteVolumeCommand; import com.cloud.agent.api.storage.PrimaryStorageDownloadAnswer; -import com.cloud.agent.api.storage.PrimaryStorageDownloadCommand; import com.cloud.agent.api.to.DataStoreTO; import com.cloud.hypervisor.xen.resource.CitrixResourceBase.SRType; import com.cloud.storage.DataStoreRole; @@ -93,8 +90,6 @@ public class XenServerStorageResource { return this.execute((AttachPrimaryDataStoreCmd)command); } else if (command instanceof CreatePrimaryDataStoreCmd) { return execute((CreatePrimaryDataStoreCmd) command); - } else if (command instanceof CreateVolumeFromBaseImageCommand) { - return execute((CreateVolumeFromBaseImageCommand)command); } else if (command instanceof CreateObjectCommand) { return execute((CreateObjectCommand) command); } else if (command instanceof DeleteVolumeCommand) { @@ -215,7 +210,7 @@ public class XenServerStorageResource { return new Answer(cmd, false, errorMsg); } - protected Answer execute(CreateVolumeFromBaseImageCommand cmd) { + /* protected Answer execute(CreateVolumeFromBaseImageCommand cmd) { VolumeObjectTO volume = cmd.getVolume(); ImageOnPrimayDataStoreTO baseImage = cmd.getImage(); Connection conn = hypervisorResource.getConnection(); @@ -232,7 +227,7 @@ public class XenServerStorageResource { } catch (XmlRpcException e) { return new Answer(cmd, false, e.toString()); } - } + }*/ protected SR getNfsSR(Connection conn, DecodedDataStore store) { http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1fe5d7c8/plugins/storage/volume/solidfire/test/org/apache/cloudstack/storage/test/VolumeTest.java ---------------------------------------------------------------------- diff --git a/plugins/storage/volume/solidfire/test/org/apache/cloudstack/storage/test/VolumeTest.java b/plugins/storage/volume/solidfire/test/org/apache/cloudstack/storage/test/VolumeTest.java index dc29fb8..91bc7ea 100644 --- a/plugins/storage/volume/solidfire/test/org/apache/cloudstack/storage/test/VolumeTest.java +++ b/plugins/storage/volume/solidfire/test/org/apache/cloudstack/storage/test/VolumeTest.java @@ -23,12 +23,9 @@ import java.util.Map; import java.util.UUID; import javax.inject.Inject; -import javax.naming.ConfigurationException; import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreInfo; -import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreProvider; import org.apache.cloudstack.storage.command.CreateObjectAnswer; -import org.apache.cloudstack.storage.command.CreateVolumeFromBaseImageCommand; import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao; import org.junit.Before; import org.junit.Test; @@ -114,15 +111,6 @@ public class VolumeTest { Mockito.when(hostDao.findHypervisorHostInCluster(Mockito.anyLong())).thenReturn(results); CreateObjectAnswer createVolumeFromImageAnswer = new CreateObjectAnswer(null,UUID.randomUUID().toString(), null); - try { - Mockito.when(agentMgr.send(Mockito.anyLong(), Mockito.any(CreateVolumeFromBaseImageCommand.class))).thenReturn(createVolumeFromImageAnswer); - } catch (AgentUnavailableException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (OperationTimedoutException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } //Mockito.when(primaryStoreDao.findById(Mockito.anyLong())).thenReturn(primaryStore);
