This close #520
This commit is contained in:
Rajani Karuturi 2015-06-24 16:29:34 +05:30
commit a3fe76a4c4
3 changed files with 5 additions and 18 deletions

View File

@ -43,7 +43,6 @@ import com.cloud.vm.VirtualMachineProfile;
@Local(value = StoragePoolAllocator.class)
public class ClusterScopeStoragePoolAllocator extends AbstractStoragePoolAllocator {
private static final Logger s_logger = Logger.getLogger(ClusterScopeStoragePoolAllocator.class);
protected String _allocationAlgorithm = "random";
@Inject
DiskOfferingDao _diskOfferingDao;

View File

@ -84,7 +84,6 @@ import java.util.concurrent.TimeUnit;
@Local(value = ServerResource.class)
public class BareMetalResourceBase extends ManagerBase implements ServerResource {
private static final Logger s_logger = Logger.getLogger(BareMetalResourceBase.class);
protected String _name;
protected String _uuid;
protected String _zone;
protected String _pod;
@ -119,7 +118,7 @@ public class BareMetalResourceBase extends ManagerBase implements ServerResource
@Override
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
_name = name;
setName(name);
_uuid = (String) params.get("guid");
try {
_memCapacity = Long.parseLong((String) params.get(ApiConstants.MEMORY)) * 1024L * 1024L;
@ -327,11 +326,6 @@ public class BareMetalResourceBase extends ManagerBase implements ServerResource
return true;
}
@Override
public String getName() {
return _name;
}
@Override
public Type getType() {
return com.cloud.host.Host.Type.Routing;
@ -550,7 +544,7 @@ public class BareMetalResourceBase extends ManagerBase implements ServerResource
OutputInterpreter.AllLinesParser interpreter = new OutputInterpreter.AllLinesParser();
if (!doScript(_getStatusCommand, interpreter)) {
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;
}
@ -572,7 +566,7 @@ public class BareMetalResourceBase extends ManagerBase implements ServerResource
OutputInterpreter.AllLinesParser interpreter = new OutputInterpreter.AllLinesParser();
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())) {
@ -633,7 +627,7 @@ public class BareMetalResourceBase extends ManagerBase implements ServerResource
protected ReadyAnswer execute(ReadyCommand cmd) {
// 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);
}

View File

@ -75,7 +75,6 @@ import com.cloud.vm.dao.UserVmDao;
@Local(value = {BaremetalPxeManager.class})
public class BaremetalPxeManagerImpl extends ManagerBase implements BaremetalPxeManager, ResourceStateAdapter {
private static final org.apache.log4j.Logger s_logger = Logger.getLogger(BaremetalPxeManagerImpl.class);
protected String _name;
@Inject
DataCenterDao _dcDao;
@Inject
@ -101,7 +100,7 @@ public class BaremetalPxeManagerImpl extends ManagerBase implements BaremetalPxe
@Override
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
_name = name;
setName(name);
_resourceMgr.registerResourceStateAdapter(this.getClass().getSimpleName(), this);
return true;
}
@ -117,11 +116,6 @@ public class BaremetalPxeManagerImpl extends ManagerBase implements BaremetalPxe
return true;
}
@Override
public String getName() {
return _name;
}
protected BaremetalPxeService getServiceByType(String type) {
for (BaremetalPxeService service : _services) {
if (service.getPxeServiceType().equals(type)) {