cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kis...@apache.org
Subject git commit: updated refs/heads/master to 08dc5c6
Date Wed, 27 Aug 2014 06:28:39 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 26904d1a2 -> 08dc5c6f9


CLOUDSTACK-7428: Allow LXC cluster in SG enabled zones. Use lxc driver in security_group.py
script for lxc host


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/08dc5c6f
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/08dc5c6f
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/08dc5c6f

Branch: refs/heads/master
Commit: 08dc5c6f91290160a902ee816501e3591e0db140
Parents: 26904d1
Author: Kishan Kavala <kishan@apache.org>
Authored: Wed Aug 27 01:11:29 2014 +0530
Committer: Kishan Kavala <kishan@apache.org>
Committed: Wed Aug 27 11:52:59 2014 +0530

----------------------------------------------------------------------
 scripts/vm/network/security_group.py                   | 13 +++++++++----
 server/src/com/cloud/resource/ResourceManagerImpl.java |  3 ++-
 2 files changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/08dc5c6f/scripts/vm/network/security_group.py
----------------------------------------------------------------------
diff --git a/scripts/vm/network/security_group.py b/scripts/vm/network/security_group.py
index 14f7e84..b4a355d 100755
--- a/scripts/vm/network/security_group.py
+++ b/scripts/vm/network/security_group.py
@@ -33,6 +33,11 @@ iptables = Command("iptables")
 bash = Command("/bin/bash")
 ebtablessave = Command("ebtables-save")
 ebtables = Command("ebtables")
+driver = "qemu:///system"
+cfo = configFileOps("/etc/cloudstack/agent/agent.properties")
+hyper = cfo.getEntry("hypervisor.type")
+if hyper == "lxc":
+    driver = "lxc:///"
 def execute(cmd):
     logging.debug(cmd)
     return bash("-c", cmd).stdout
@@ -96,7 +101,7 @@ def virshlist(*states):
 
     searchstates = list(libvirt_states[state] for state in states)
 
-    conn = libvirt.openReadOnly('qemu:///system')
+    conn = libvirt.openReadOnly(driver)
     if conn == None:
        print 'Failed to open connection to the hypervisor'
        sys.exit(3)
@@ -124,7 +129,7 @@ def virshdomstate(domain):
                      libvirt.VIR_DOMAIN_CRASHED  : 'crashed',
     }
 
-    conn = libvirt.openReadOnly('qemu:///system')
+    conn = libvirt.openReadOnly(driver)
     if conn == None:
        print 'Failed to open connection to the hypervisor'
        sys.exit(3)
@@ -141,7 +146,7 @@ def virshdomstate(domain):
 
 def virshdumpxml(domain):
 
-    conn = libvirt.openReadOnly('qemu:///system')
+    conn = libvirt.openReadOnly(driver)
     if conn == None:
        print 'Failed to open connection to the hypervisor'
        sys.exit(3)
@@ -925,7 +930,7 @@ def getBridges(vmName):
 
 def getvmId(vmName):
 
-    conn = libvirt.openReadOnly('qemu:///system')
+    conn = libvirt.openReadOnly(driver)
     if conn == None:
        print 'Failed to open connection to the hypervisor'
        sys.exit(3)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/08dc5c6f/server/src/com/cloud/resource/ResourceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/resource/ResourceManagerImpl.java b/server/src/com/cloud/resource/ResourceManagerImpl.java
index 5008621..3405f99 100755
--- a/server/src/com/cloud/resource/ResourceManagerImpl.java
+++ b/server/src/com/cloud/resource/ResourceManagerImpl.java
@@ -419,7 +419,8 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
         }
 
         if (zone.isSecurityGroupEnabled() && zone.getNetworkType().equals(NetworkType.Advanced))
{
-            if (hypervisorType != HypervisorType.KVM && hypervisorType != HypervisorType.XenServer
&& hypervisorType != HypervisorType.Simulator) {
+            if (hypervisorType != HypervisorType.KVM && hypervisorType != HypervisorType.XenServer
+                    && hypervisorType != HypervisorType.LXC && hypervisorType
!= HypervisorType.Simulator) {
                 throw new InvalidParameterValueException("Don't support hypervisor type "
+ hypervisorType + " in advanced security enabled zone");
             }
         }


Mime
View raw message