don't program security rules in XS host if the zone is not SG enabled

This commit is contained in:
Anthony Xu 2013-11-20 17:01:53 -08:00
parent 465ac16258
commit b2b4b45ae4
1 changed files with 12 additions and 1 deletions

View File

@ -312,7 +312,6 @@ public class XcpServerDiscoverer extends DiscovererBase implements Discoverer, L
DataCenterVO zone = _dcDao.findById(dcId);
boolean securityGroupEnabled = zone.isSecurityGroupEnabled();
params.put("securitygroupenabled", Boolean.toString(securityGroupEnabled));
details.put("securitygroupenabled", Boolean.toString(securityGroupEnabled));
params.put("wait", Integer.toString(_wait));
details.put("wait", Integer.toString(_wait));
@ -743,6 +742,18 @@ public class XcpServerDiscoverer extends DiscovererBase implements Discoverer, L
return new DeleteHostAnswer(true);
}
protected HashMap<String, Object> buildConfigParams(HostVO host){
HashMap<String, Object> params = super.buildConfigParams(host);
DataCenterVO zone = _dcDao.findById(host.getDataCenterId());
if ( zone != null ) {
boolean securityGroupEnabled = zone.isSecurityGroupEnabled();
params.put("securitygroupenabled", Boolean.toString(securityGroupEnabled));
}
return params;
}
@Override
public boolean stop() {
_resourceMgr.unregisterResourceStateAdapter(this.getClass().getSimpleName());