Skip to content

Commit b2b4b45

Browse files
author
Anthony Xu
committed
don't program security rules in XS host if the zone is not SG enabled
1 parent 465ac16 commit b2b4b45

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

‎plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,6 @@ public Map<? extends ServerResource, Map<String, String>> find(long dcId, Long p
312312
DataCenterVO zone = _dcDao.findById(dcId);
313313
boolean securityGroupEnabled = zone.isSecurityGroupEnabled();
314314
params.put("securitygroupenabled", Boolean.toString(securityGroupEnabled));
315-
details.put("securitygroupenabled", Boolean.toString(securityGroupEnabled));
316315

317316
params.put("wait", Integer.toString(_wait));
318317
details.put("wait", Integer.toString(_wait));
@@ -743,6 +742,18 @@ public DeleteHostAnswer deleteHost(HostVO host, boolean isForced, boolean isForc
743742
return new DeleteHostAnswer(true);
744743
}
745744

745+
746+
protected HashMap<String, Object> buildConfigParams(HostVO host){
747+
HashMap<String, Object> params = super.buildConfigParams(host);
748+
DataCenterVO zone = _dcDao.findById(host.getDataCenterId());
749+
if ( zone != null ) {
750+
boolean securityGroupEnabled = zone.isSecurityGroupEnabled();
751+
params.put("securitygroupenabled", Boolean.toString(securityGroupEnabled));
752+
}
753+
return params;
754+
}
755+
756+
746757
@Override
747758
public boolean stop() {
748759
_resourceMgr.unregisterResourceStateAdapter(this.getClass().getSimpleName());

0 commit comments

Comments
 (0)