mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-9252: Little refactor
This commit is contained in:
parent
c5677cf634
commit
64c6debf00
@ -38,8 +38,6 @@
|
||||
class="org.apache.cloudstack.storage.image.datastore.ImageStoreHelper" />
|
||||
<bean id="imageFormatHelper"
|
||||
class="org.apache.cloudstack.storage.image.format.ImageFormatHelper" />
|
||||
<bean id="imageStoreDetailsUtil"
|
||||
class="com.cloud.storage.ImageStoreDetailsUtil" />
|
||||
|
||||
<bean id="imageStoreProviderMgr"
|
||||
class="org.apache.cloudstack.storage.image.manager.ImageStoreProviderManagerImpl" />
|
||||
|
||||
@ -69,5 +69,7 @@
|
||||
<property name="snapshotStrategies" value="#{snapshotStrategiesRegistry.registered}" />
|
||||
<property name="vmSnapshotStrategies" value="#{vmSnapshotStrategiesRegistry.registered}" />
|
||||
</bean>
|
||||
|
||||
<bean id="imageStoreDetailsUtil" class="com.cloud.storage.ImageStoreDetailsUtil" />
|
||||
|
||||
</beans>
|
||||
|
||||
@ -201,10 +201,8 @@ public class VmwareManagerImpl extends ManagerBase implements VmwareManager, Vmw
|
||||
|
||||
private final ScheduledExecutorService _hostScanScheduler = Executors.newScheduledThreadPool(1, new NamedThreadFactory("Vmware-Host-Scan"));
|
||||
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
public VmwareManagerImpl() {
|
||||
applicationContext = ComponentContext.getApplicationContext();
|
||||
ApplicationContext applicationContext = ComponentContext.getApplicationContext();
|
||||
imageStoreDetailsUtil = applicationContext.getBean("imageStoreDetailsUtil", ImageStoreDetailsUtil.class);
|
||||
_storageMgr = new VmwareStorageManagerImpl(this);
|
||||
}
|
||||
|
||||
@ -96,7 +96,6 @@ import org.apache.cloudstack.storage.command.UploadStatusAnswer;
|
||||
import org.apache.cloudstack.storage.command.UploadStatusAnswer.UploadStatus;
|
||||
import org.apache.cloudstack.storage.datastore.db.ImageStoreDao;
|
||||
import org.apache.cloudstack.storage.datastore.db.ImageStoreDetailsDao;
|
||||
import org.apache.cloudstack.storage.datastore.db.ImageStoreVO;
|
||||
import org.apache.cloudstack.storage.command.UploadStatusCommand;
|
||||
import org.apache.cloudstack.storage.template.DownloadManager;
|
||||
import org.apache.cloudstack.storage.template.DownloadManagerImpl;
|
||||
@ -229,8 +228,6 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S
|
||||
@Inject
|
||||
ImageStoreDetailsDao detailsStoreDao;
|
||||
|
||||
public static final String IMAGE_STORE_PARAMETER_ID = "imageStoreId";
|
||||
|
||||
public void setParentPath(String path) {
|
||||
_parent = path;
|
||||
}
|
||||
@ -1316,16 +1313,6 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S
|
||||
}
|
||||
}
|
||||
|
||||
private Long getImageStoreId(DataStoreTO dataStore){
|
||||
Long imgStoreId = null;
|
||||
if (dataStore.getRole().equals(DataStoreRole.Image)){
|
||||
String uuid = dataStore.getUuid();
|
||||
ImageStoreVO imageStoreVO = dataStoreDao.findByUuid(uuid);
|
||||
imgStoreId = imageStoreVO.getId();
|
||||
}
|
||||
return imgStoreId;
|
||||
}
|
||||
|
||||
private Answer execute(SecStorageSetupCommand cmd) {
|
||||
if (!_inSystemVM) {
|
||||
return new Answer(cmd, true, null);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user