mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Merge branch 'findbugs-MF' of https://github.com/DaanHoogland/cloudstack
This close #520
This commit is contained in:
commit
a3fe76a4c4
@ -43,7 +43,6 @@ import com.cloud.vm.VirtualMachineProfile;
|
|||||||
@Local(value = StoragePoolAllocator.class)
|
@Local(value = StoragePoolAllocator.class)
|
||||||
public class ClusterScopeStoragePoolAllocator extends AbstractStoragePoolAllocator {
|
public class ClusterScopeStoragePoolAllocator extends AbstractStoragePoolAllocator {
|
||||||
private static final Logger s_logger = Logger.getLogger(ClusterScopeStoragePoolAllocator.class);
|
private static final Logger s_logger = Logger.getLogger(ClusterScopeStoragePoolAllocator.class);
|
||||||
protected String _allocationAlgorithm = "random";
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
DiskOfferingDao _diskOfferingDao;
|
DiskOfferingDao _diskOfferingDao;
|
||||||
|
|||||||
@ -84,7 +84,6 @@ import java.util.concurrent.TimeUnit;
|
|||||||
@Local(value = ServerResource.class)
|
@Local(value = ServerResource.class)
|
||||||
public class BareMetalResourceBase extends ManagerBase implements ServerResource {
|
public class BareMetalResourceBase extends ManagerBase implements ServerResource {
|
||||||
private static final Logger s_logger = Logger.getLogger(BareMetalResourceBase.class);
|
private static final Logger s_logger = Logger.getLogger(BareMetalResourceBase.class);
|
||||||
protected String _name;
|
|
||||||
protected String _uuid;
|
protected String _uuid;
|
||||||
protected String _zone;
|
protected String _zone;
|
||||||
protected String _pod;
|
protected String _pod;
|
||||||
@ -119,7 +118,7 @@ public class BareMetalResourceBase extends ManagerBase implements ServerResource
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
|
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
|
||||||
_name = name;
|
setName(name);
|
||||||
_uuid = (String) params.get("guid");
|
_uuid = (String) params.get("guid");
|
||||||
try {
|
try {
|
||||||
_memCapacity = Long.parseLong((String) params.get(ApiConstants.MEMORY)) * 1024L * 1024L;
|
_memCapacity = Long.parseLong((String) params.get(ApiConstants.MEMORY)) * 1024L * 1024L;
|
||||||
@ -327,11 +326,6 @@ public class BareMetalResourceBase extends ManagerBase implements ServerResource
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getName() {
|
|
||||||
return _name;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Type getType() {
|
public Type getType() {
|
||||||
return com.cloud.host.Host.Type.Routing;
|
return com.cloud.host.Host.Type.Routing;
|
||||||
@ -550,7 +544,7 @@ public class BareMetalResourceBase extends ManagerBase implements ServerResource
|
|||||||
OutputInterpreter.AllLinesParser interpreter = new OutputInterpreter.AllLinesParser();
|
OutputInterpreter.AllLinesParser interpreter = new OutputInterpreter.AllLinesParser();
|
||||||
if (!doScript(_getStatusCommand, interpreter)) {
|
if (!doScript(_getStatusCommand, interpreter)) {
|
||||||
success = true;
|
success = true;
|
||||||
s_logger.warn("Cannot get power status of " + _name + ", assume VM state changed successfully");
|
s_logger.warn("Cannot get power status of " + getName() + ", assume VM state changed successfully");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -572,7 +566,7 @@ public class BareMetalResourceBase extends ManagerBase implements ServerResource
|
|||||||
|
|
||||||
OutputInterpreter.AllLinesParser interpreter = new OutputInterpreter.AllLinesParser();
|
OutputInterpreter.AllLinesParser interpreter = new OutputInterpreter.AllLinesParser();
|
||||||
if (!doScript(_getStatusCommand, interpreter)) {
|
if (!doScript(_getStatusCommand, interpreter)) {
|
||||||
return new StartAnswer(cmd, "Cannot get current power status of " + _name);
|
return new StartAnswer(cmd, "Cannot get current power status of " + getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isPowerOn(interpreter.getLines())) {
|
if (isPowerOn(interpreter.getLines())) {
|
||||||
@ -633,7 +627,7 @@ public class BareMetalResourceBase extends ManagerBase implements ServerResource
|
|||||||
|
|
||||||
protected ReadyAnswer execute(ReadyCommand cmd) {
|
protected ReadyAnswer execute(ReadyCommand cmd) {
|
||||||
// derived resource should check if the PXE server is ready
|
// derived resource should check if the PXE server is ready
|
||||||
s_logger.debug("Bare metal resource " + _name + " is ready");
|
s_logger.debug("Bare metal resource " + getName() + " is ready");
|
||||||
return new ReadyAnswer(cmd);
|
return new ReadyAnswer(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -75,7 +75,6 @@ import com.cloud.vm.dao.UserVmDao;
|
|||||||
@Local(value = {BaremetalPxeManager.class})
|
@Local(value = {BaremetalPxeManager.class})
|
||||||
public class BaremetalPxeManagerImpl extends ManagerBase implements BaremetalPxeManager, ResourceStateAdapter {
|
public class BaremetalPxeManagerImpl extends ManagerBase implements BaremetalPxeManager, ResourceStateAdapter {
|
||||||
private static final org.apache.log4j.Logger s_logger = Logger.getLogger(BaremetalPxeManagerImpl.class);
|
private static final org.apache.log4j.Logger s_logger = Logger.getLogger(BaremetalPxeManagerImpl.class);
|
||||||
protected String _name;
|
|
||||||
@Inject
|
@Inject
|
||||||
DataCenterDao _dcDao;
|
DataCenterDao _dcDao;
|
||||||
@Inject
|
@Inject
|
||||||
@ -101,7 +100,7 @@ public class BaremetalPxeManagerImpl extends ManagerBase implements BaremetalPxe
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
|
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
|
||||||
_name = name;
|
setName(name);
|
||||||
_resourceMgr.registerResourceStateAdapter(this.getClass().getSimpleName(), this);
|
_resourceMgr.registerResourceStateAdapter(this.getClass().getSimpleName(), this);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -117,11 +116,6 @@ public class BaremetalPxeManagerImpl extends ManagerBase implements BaremetalPxe
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getName() {
|
|
||||||
return _name;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected BaremetalPxeService getServiceByType(String type) {
|
protected BaremetalPxeService getServiceByType(String type) {
|
||||||
for (BaremetalPxeService service : _services) {
|
for (BaremetalPxeService service : _services) {
|
||||||
if (service.getPxeServiceType().equals(type)) {
|
if (service.getPxeServiceType().equals(type)) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user