From b2b4b45ae4630d2dba68dc4701f90566bc526d26 Mon Sep 17 00:00:00 2001 From: Anthony Xu Date: Wed, 20 Nov 2013 17:01:53 -0800 Subject: [PATCH] don't program security rules in XS host if the zone is not SG enabled --- .../xen/discoverer/XcpServerDiscoverer.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java index d3a345fc1c8..a05456c2df6 100755 --- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java @@ -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 buildConfigParams(HostVO host){ + HashMap 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());