You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by re...@apache.org on 2015/10/24 09:16:19 UTC

[1/6] git commit: updated refs/heads/master to b1c7d4b

Repository: cloudstack
Updated Branches:
  refs/heads/master ecc2e2f39 -> b1c7d4b20


CLOUDSTACK-8935 - Add a check to avoid exception related to None value


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

Branch: refs/heads/master
Commit: 3725b3ee30c075bedaaf62cde9ed3d5fc5a5bc92
Parents: e7638c0
Author: Wilder Rodrigues <wr...@schubergphilis.com>
Authored: Thu Oct 22 13:03:06 2015 +0200
Committer: Wilder Rodrigues <wr...@schubergphilis.com>
Committed: Thu Oct 22 13:03:06 2015 +0200

----------------------------------------------------------------------
 systemvm/patches/debian/config/opt/cloud/bin/cs/CsDhcp.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3725b3ee/systemvm/patches/debian/config/opt/cloud/bin/cs/CsDhcp.py
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsDhcp.py b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsDhcp.py
index 02e7bd7..6200d48 100755
--- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsDhcp.py
+++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsDhcp.py
@@ -69,9 +69,10 @@ class CsDhcp(CsDataBag):
             line = "dhcp-option=tag:interface-%s,15,%s" % (device, gn.get_domain())
             self.conf.search(sline, line)
             # DNS search order
-            sline = "dhcp-option=tag:interface-%s,6" % device
-            line = "dhcp-option=tag:interface-%s,6,%s" % (device, ','.join(gn.get_dns()))
-            self.conf.search(sline, line)
+            if gn.get_dns() and device:
+                sline = "dhcp-option=tag:interface-%s,6" % device
+                line = "dhcp-option=tag:interface-%s,6,%s" % (device, ','.join(gn.get_dns()))
+                self.conf.search(sline, line)
             # Gateway
             gateway = ''
             if self.config.is_vpc():


[6/6] git commit: updated refs/heads/master to b1c7d4b

Posted by re...@apache.org.
Merge pull request #967 from ekholabs/fix/cleanup-CLOUDSTACK-8935

CLOUDSTACK-8935 - Cannot remove [r]VPC networks due to RTNETLINK errorThis PR fixes the "sequence item 0: expected string, NoneType found" error found in the CsDhcp.py file when attempting to remo a network from a VPC.

* pr/967:
  CLOUDSTACK-8935 - Filter the DNS list because it might contain 1 None entry which breaks the code.
  CLOUDSTACK-8935 - Clean up network resources in the right order
  CLOUDSTACK-8935 - Do not retry 60 times when we expect the SSH to fail
  CLOUDSTACK-8935 - Check if the key is available in the dictionary
  CLOUDSTACK-8935 - Add a check to avoid exception related to None value

Signed-off-by: Remi Bergsma <gi...@remi.nl>


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

Branch: refs/heads/master
Commit: b1c7d4b20de9e6c2f38b5c5e9be761707f1c56c1
Parents: ecc2e2f a01720b
Author: Remi Bergsma <gi...@remi.nl>
Authored: Sat Oct 24 09:14:56 2015 +0200
Committer: Remi Bergsma <gi...@remi.nl>
Committed: Sat Oct 24 09:14:56 2015 +0200

----------------------------------------------------------------------
 .../debian/config/opt/cloud/bin/cs/CsDhcp.py    |   8 +-
 .../config/opt/cloud/bin/cs/CsGuestNetwork.py   |   2 +-
 .../integration/component/test_vpc_offerings.py | 196 ++++++++++---------
 test/integration/smoke/test_network.py          |   7 +-
 4 files changed, 118 insertions(+), 95 deletions(-)
----------------------------------------------------------------------



[4/6] git commit: updated refs/heads/master to b1c7d4b

Posted by re...@apache.org.
CLOUDSTACK-8935 - Clean up network resources in the right order


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

Branch: refs/heads/master
Commit: 3ead9d72299013f027f479d264e60602e83f6e5d
Parents: 3eb6ba0
Author: Wilder Rodrigues <wr...@schubergphilis.com>
Authored: Fri Oct 23 16:00:09 2015 +0200
Committer: Wilder Rodrigues <wr...@schubergphilis.com>
Committed: Fri Oct 23 16:00:09 2015 +0200

----------------------------------------------------------------------
 .../integration/component/test_vpc_offerings.py | 196 ++++++++++---------
 1 file changed, 107 insertions(+), 89 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3ead9d72/test/integration/component/test_vpc_offerings.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_vpc_offerings.py b/test/integration/component/test_vpc_offerings.py
index 6ae8277..5424cbe 100644
--- a/test/integration/component/test_vpc_offerings.py
+++ b/test/integration/component/test_vpc_offerings.py
@@ -29,6 +29,7 @@ from marvin.lib.common import *
 from marvin.sshClient import SshClient
 import datetime
 
+import logging
 
 class Services:
     """Test inter VLAN services
@@ -163,6 +164,12 @@ class TestVPCOffering(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
+
+        cls.logger = logging.getLogger('TestVPCOffering')
+        cls.stream_handler = logging.StreamHandler()
+        cls.logger.setLevel(logging.DEBUG)
+        cls.logger.addHandler(cls.stream_handler)
+
         cls.testClient = super(TestVPCOffering, cls).getClsTestClient()
         cls.api_client = cls.testClient.getApiClient()
 
@@ -197,7 +204,7 @@ class TestVPCOffering(cloudstackTestCase):
         return
 
     def setUp(self):
-        self.debug("test_vpc_offering#setUp")
+        self.logger.debug("test_vpc_offering#setUp")
         self.apiclient = self.testClient.getApiClient()
         self.dbclient = self.testClient.getDbConnection()
         self.account = Account.create(
@@ -211,7 +218,7 @@ class TestVPCOffering(cloudstackTestCase):
         return
 
     def tearDown(self):
-        self.debug("test_vpc_offering#tearDown")
+        self.logger.debug("test_vpc_offering#tearDown")
         try:
             cleanup_resources(self.apiclient, self.cleanup)
         except Exception as e:
@@ -221,7 +228,7 @@ class TestVPCOffering(cloudstackTestCase):
     def validate_vpc_offering(self, vpc_offering):
         """Validates the VPC offering"""
 
-        self.debug("Check if the VPC offering is created successfully?")
+        self.logger.debug("Check if the VPC offering is created successfully?")
         vpc_offs = VpcOffering.list(
                                     self.apiclient,
                                     id=vpc_offering.id
@@ -236,7 +243,7 @@ class TestVPCOffering(cloudstackTestCase):
                  vpc_offs[0].name,
                 "Name of the VPC offering should match with listVPCOff data"
                 )
-        self.debug(
+        self.logger.debug(
                 "VPC offering is created successfully - %s" %
                                                         vpc_offering.name)
         return
@@ -244,7 +251,7 @@ class TestVPCOffering(cloudstackTestCase):
     def validate_vpc_network(self, network):
         """Validates the VPC network"""
 
-        self.debug("Check if the VPC network is created successfully?")
+        self.logger.debug("Check if the VPC network is created successfully?")
         vpc_networks = VPC.list(
                                     self.apiclient,
                                     id=network.id
@@ -259,7 +266,7 @@ class TestVPCOffering(cloudstackTestCase):
                  vpc_networks[0].name,
                  "Name of the VPC network should match with listVPC data"
                 )
-        self.debug("VPC network created successfully - %s" % network.name)
+        self.logger.debug("VPC network created successfully - %s" % network.name)
         return
 
     @attr(tags=["advanced", "intervlan"], required_hardware="false")
@@ -271,13 +278,13 @@ class TestVPCOffering(cloudstackTestCase):
         # 1. Create VPC Offering by specifying all supported Services
         # 2. VPC offering should be created successfully.
 
-        self.debug("Creating inter VPC offering")
+        self.logger.debug("Creating inter VPC offering")
         vpc_off = VpcOffering.create(
                                      self.apiclient,
                                      self.services["vpc_offering"]
                                      )
 
-        self.debug("Check if the VPC offering is created successfully?")
+        self.logger.debug("Check if the VPC offering is created successfully?")
         self.cleanup.append(vpc_off)
         self.validate_vpc_offering(vpc_off)
         return
@@ -299,7 +306,7 @@ class TestVPCOffering(cloudstackTestCase):
         # 9. Create Egress Network ACL for this network to access google.com.
         # 10. Enable VPN services
 
-        self.debug("Creating a VPC offering..")
+        self.logger.debug("Creating a VPC offering..")
         vpc_off = VpcOffering.create(
                                      self.apiclient,
                                      self.services["vpc_offering"]
@@ -307,10 +314,10 @@ class TestVPCOffering(cloudstackTestCase):
 
         self.validate_vpc_offering(vpc_off)
 
-        self.debug("Enabling the VPC offering created")
+        self.logger.debug("Enabling the VPC offering created")
         vpc_off.update(self.apiclient, state='Enabled')
 
-        self.debug("creating a VPC network in the account: %s" %
+        self.logger.debug("creating a VPC network in the account: %s" %
                                                     self.account.name)
         vpc = VPC.create(
                          self.apiclient,
@@ -336,7 +343,7 @@ class TestVPCOffering(cloudstackTestCase):
         # Gateway = 10.0.0.1
 
         # Creating network using the network offering created
-        self.debug("Creating network with network offering: %s" %
+        self.logger.debug("Creating network with network offering: %s" %
                                                     self.network_offering.id)
         network = Network.create(
                                 self.apiclient,
@@ -348,7 +355,7 @@ class TestVPCOffering(cloudstackTestCase):
                                 gateway=gateway,
                                 vpcid=vpc.id
                                 )
-        self.debug("Created network with ID: %s" % network.id)
+        self.logger.debug("Created network with ID: %s" % network.id)
         # Spawn an instance in that network
         virtual_machine = VirtualMachine.create(
                                   self.apiclient,
@@ -358,9 +365,9 @@ class TestVPCOffering(cloudstackTestCase):
                                   serviceofferingid=self.service_offering.id,
                                   networkids=[str(network.id)]
                                   )
-        self.debug("Deployed VM in network: %s" % network.id)
+        self.logger.debug("Deployed VM in network: %s" % network.id)
 
-        self.debug("Associating public IP for network: %s" % network.name)
+        self.logger.debug("Associating public IP for network: %s" % network.name)
         public_ip = PublicIPAddress.create(
                                 self.apiclient,
                                 accountid=self.account.name,
@@ -369,12 +376,12 @@ class TestVPCOffering(cloudstackTestCase):
                                 networkid=network.id,
                                 vpcid=vpc.id
                                 )
-        self.debug("Associated %s with network %s" % (
+        self.logger.debug("Associated %s with network %s" % (
                                         public_ip.ipaddress.ipaddress,
                                         network.id
                                         ))
 
-        self.debug("Creating LB rule for IP address: %s" %
+        self.logger.debug("Creating LB rule for IP address: %s" %
                                         public_ip.ipaddress.ipaddress)
 
         lb_rule = LoadBalancerRule.create(
@@ -387,7 +394,7 @@ class TestVPCOffering(cloudstackTestCase):
                                     domainid=self.account.domainid
                                 )
 
-        self.debug("Associating public IP for network: %s" % vpc.name)
+        self.logger.debug("Associating public IP for network: %s" % vpc.name)
         public_ip_2 = PublicIPAddress.create(
                                 self.apiclient,
                                 accountid=self.account.name,
@@ -396,7 +403,7 @@ class TestVPCOffering(cloudstackTestCase):
                                 networkid=network.id,
                                 vpcid=vpc.id
                                 )
-        self.debug("Associated %s with network %s" % (
+        self.logger.debug("Associated %s with network %s" % (
                                         public_ip_2.ipaddress.ipaddress,
                                         network.id
                                         ))
@@ -411,7 +418,7 @@ class TestVPCOffering(cloudstackTestCase):
                                   vpcid=vpc.id
                                   )
 
-        self.debug("Adding NetwrokACl rules to make PF and LB accessible")
+        self.logger.debug("Adding NetwrokACl rules to make PF and LB accessible")
         networkacl_1 = NetworkACL.create(
                 self.apiclient,
                 networkid=network.id,
@@ -425,17 +432,17 @@ class TestVPCOffering(cloudstackTestCase):
                                 services=self.services["lbrule"],
                                 traffictype='Ingress'
                                 )
-        self.debug("Checking if we can SSH into VM?")
+        self.logger.debug("Checking if we can SSH into VM?")
         try:
             virtual_machine.get_ssh_client(
                 ipaddress=public_ip_2.ipaddress.ipaddress,
                 )
-            self.debug("SSH into VM is successfully")
+            self.logger.debug("SSH into VM is successfully")
         except Exception as e:
             self.fail("Failed to SSH into VM - %s, %s" %
                     (public_ip_2.ipaddress.ipaddress, e))
 
-        self.debug("Associating public IP for network: %s" % network.name)
+        self.logger.debug("Associating public IP for network: %s" % network.name)
         public_ip_3 = PublicIPAddress.create(
                                 self.apiclient,
                                 accountid=self.account.name,
@@ -444,11 +451,11 @@ class TestVPCOffering(cloudstackTestCase):
                                 networkid=network.id,
                                 vpcid=vpc.id
                                 )
-        self.debug("Associated %s with network %s" % (
+        self.logger.debug("Associated %s with network %s" % (
                                         public_ip_3.ipaddress.ipaddress,
                                         network.id
                                         ))
-        self.debug("Enabling static NAT for IP: %s" %
+        self.logger.debug("Enabling static NAT for IP: %s" %
                                             public_ip_3.ipaddress.ipaddress)
         try:
             StaticNATRule.enable(
@@ -457,7 +464,7 @@ class TestVPCOffering(cloudstackTestCase):
                               virtualmachineid=virtual_machine.id,
                               networkid=network.id
                               )
-            self.debug("Static NAT enabled for IP: %s" %
+            self.logger.debug("Static NAT enabled for IP: %s" %
                                             public_ip_3.ipaddress.ipaddress)
         except Exception as e:
             self.fail("Failed to enable static NAT on IP: %s - %s" % (
@@ -496,7 +503,7 @@ class TestVPCOffering(cloudstackTestCase):
         # 4. Deploy few Vms.
         # 5. Try to create a LB rule for this VM. LB creation should fail
 
-        self.debug(
+        self.logger.debug(
                    "Creating a VPC offering with Vpn,dhcpdns,UserData," +
                    " SourceNat,Static NAT and PF services"
                    )
@@ -521,20 +528,21 @@ class TestVPCOffering(cloudstackTestCase):
                                             )
         # Enable Network offering
         self.network_offering.update(self.apiclient, state='Enabled')
-        self.cleanup.append(self.network_offering)
+        self.cleanup.insert(0, self.network_offering)
 
         vpc_off = VpcOffering.create(
                                      self.apiclient,
                                      self.services["vpc_offering"]
                                      )
 
-        self.cleanup.append(vpc_off)
         self.validate_vpc_offering(vpc_off)
 
-        self.debug("Enabling the VPC offering created")
+        self.logger.debug("Enabling the VPC offering created")
         vpc_off.update(self.apiclient, state='Enabled')
+        
+        self.cleanup.insert(0, vpc_off)
 
-        self.debug("creating a VPC network in the account: %s" %
+        self.logger.debug("creating a VPC network in the account: %s" %
                                                     self.account.name)
         vpc = VPC.create(
                          self.apiclient,
@@ -545,6 +553,7 @@ class TestVPCOffering(cloudstackTestCase):
                          domainid=self.account.domainid
                          )
         self.validate_vpc_network(vpc)
+        self.cleanup.insert(0, vpc)
 
         gateway = vpc.cidr.split('/')[0]
         # Split the cidr to retrieve gateway
@@ -552,7 +561,7 @@ class TestVPCOffering(cloudstackTestCase):
         # Gateway = 10.0.0.1
 
         # Creating network using the network offering created
-        self.debug("Creating network with network offering: %s" %
+        self.logger.debug("Creating network with network offering: %s" %
                                                     self.network_offering.id)
         network = Network.create(
                                 self.apiclient,
@@ -564,9 +573,10 @@ class TestVPCOffering(cloudstackTestCase):
                                 gateway=gateway,
                                 vpcid=vpc.id
                                 )
-        self.debug("Created network with ID: %s" % network.id)
+        self.logger.debug("Created network with ID: %s" % network.id)
+        self.cleanup.insert(0, network)
 
-        self.debug("Deploying virtual machines in network: %s" % vpc.name)
+        self.logger.debug("Deploying virtual machines in network: %s" % vpc.name)
         # Spawn an instance in that network
         virtual_machine = VirtualMachine.create(
                                   self.apiclient,
@@ -576,9 +586,10 @@ class TestVPCOffering(cloudstackTestCase):
                                   serviceofferingid=self.service_offering.id,
                                   networkids=[str(network.id)]
                                   )
-        self.debug("Deployed VM in network: %s" % network.id)
+        self.logger.debug("Deployed VM in network: %s" % network.id)
+        self.cleanup.insert(0, virtual_machine)
 
-        self.debug("Associating public IP for network: %s" % network.name)
+        self.logger.debug("Associating public IP for network: %s" % network.name)
         public_ip = PublicIPAddress.create(
                                 self.apiclient,
                                 accountid=self.account.name,
@@ -587,12 +598,12 @@ class TestVPCOffering(cloudstackTestCase):
                                 networkid=network.id,
                                 vpcid=vpc.id
                                 )
-        self.debug("Associated %s with network %s" % (
+        self.logger.debug("Associated %s with network %s" % (
                                         public_ip.ipaddress.ipaddress,
                                         vpc.id
                                         ))
 
-        self.debug("Trying to LB rule for IP address: %s" %
+        self.logger.debug("Trying to LB rule for IP address: %s" %
                                         public_ip.ipaddress.ipaddress)
         with self.assertRaises(Exception):
             LoadBalancerRule.create(
@@ -617,7 +628,7 @@ class TestVPCOffering(cloudstackTestCase):
         # 4. Deploy few Vms
         # 5. Try to create NAT rule for this VMStatic NAT creation should fail
 
-        self.debug("Creating a VPC offering with Vpn,dhcpdns,UserData," +
+        self.logger.debug("Creating a VPC offering with Vpn,dhcpdns,UserData," +
                    "SourceNat,lb and PF services")
 
         self.services["vpc_offering"]["supportedservices"] = 'Vpn,Dhcp,Dns,SourceNat,Lb,UserData,PortForwarding,NetworkACL'
@@ -640,20 +651,20 @@ class TestVPCOffering(cloudstackTestCase):
                                             )
         # Enable Network offering
         self.network_offering.update(self.apiclient, state='Enabled')
-        self.cleanup.append(self.network_offering)
+        self.cleanup.insert(0, self.network_offering)
 
         vpc_off = VpcOffering.create(
                                      self.apiclient,
                                      self.services["vpc_offering"]
                                      )
 
-        self.cleanup.append(vpc_off)
         self.validate_vpc_offering(vpc_off)
 
-        self.debug("Enabling the VPC offering created")
+        self.logger.debug("Enabling the VPC offering created")
         vpc_off.update(self.apiclient, state='Enabled')
+        self.cleanup.insert(0, vpc_off)
 
-        self.debug("creating a VPC network in the account: %s" %
+        self.logger.debug("creating a VPC network in the account: %s" %
                                                     self.account.name)
         vpc = VPC.create(
                          self.apiclient,
@@ -664,6 +675,7 @@ class TestVPCOffering(cloudstackTestCase):
                          domainid=self.account.domainid
                          )
         self.validate_vpc_network(vpc)
+        self.cleanup.insert(0, vpc)
 
         gateway = vpc.cidr.split('/')[0]
         # Split the cidr to retrieve gateway
@@ -671,7 +683,7 @@ class TestVPCOffering(cloudstackTestCase):
         # Gateway = 10.0.0.1
 
         # Creating network using the network offering created
-        self.debug("Creating network with network offering: %s" %
+        self.logger.debug("Creating network with network offering: %s" %
                                                     self.network_offering.id)
         network = Network.create(
                                 self.apiclient,
@@ -683,9 +695,10 @@ class TestVPCOffering(cloudstackTestCase):
                                 gateway=gateway,
                                 vpcid=vpc.id
                                 )
-        self.debug("Created network with ID: %s" % network.id)
+        self.logger.debug("Created network with ID: %s" % network.id)
+        self.cleanup.insert(0, network)
 
-        self.debug("Deploying virtual machines in network: %s" % vpc.name)
+        self.logger.debug("Deploying virtual machines in network: %s" % vpc.name)
         # Spawn an instance in that network
         virtual_machine = VirtualMachine.create(
                                   self.apiclient,
@@ -695,9 +708,10 @@ class TestVPCOffering(cloudstackTestCase):
                                   serviceofferingid=self.service_offering.id,
                                   networkids=[str(network.id)]
                                   )
-        self.debug("Deployed VM in network: %s" % network.id)
+        self.logger.debug("Deployed VM in network: %s" % network.id)
+        self.cleanup.insert(0, virtual_machine)
 
-        self.debug("Associating public IP for network: %s" % network.name)
+        self.logger.debug("Associating public IP for network: %s" % network.name)
         public_ip = PublicIPAddress.create(
                                 self.apiclient,
                                 accountid=self.account.name,
@@ -706,7 +720,7 @@ class TestVPCOffering(cloudstackTestCase):
                                 networkid=network.id,
                                 vpcid=vpc.id
                                 )
-        self.debug("Associated %s with network %s" % (
+        self.logger.debug("Associated %s with network %s" % (
                                         public_ip.ipaddress.ipaddress,
                                         network.id
                                         ))
@@ -736,7 +750,7 @@ class TestVPCOffering(cloudstackTestCase):
         # 4. Deploy few Vms.
         # 5. Try to create a PF rule for this VM. PF creation should fail
 
-        self.debug(
+        self.logger.debug(
                    "Creating a VPC offering with Vpn,dhcpdns,UserData," +
                    "SourceNat,Static NAT and lb services"
                    )
@@ -761,20 +775,20 @@ class TestVPCOffering(cloudstackTestCase):
                                             )
         # Enable Network offering
         self.network_offering.update(self.apiclient, state='Enabled')
-        self.cleanup.append(self.network_offering)
+        self.cleanup.insert(0, self.network_offering)
 
         vpc_off = VpcOffering.create(
                                      self.apiclient,
                                      self.services["vpc_offering"]
                                      )
 
-        self.cleanup.append(vpc_off)
         self.validate_vpc_offering(vpc_off)
 
-        self.debug("Enabling the VPC offering created")
+        self.logger.debug("Enabling the VPC offering created")
         vpc_off.update(self.apiclient, state='Enabled')
+        self.cleanup.insert(0, vpc_off)
 
-        self.debug("creating a VPC network in the account: %s" %
+        self.logger.debug("creating a VPC network in the account: %s" %
                                                     self.account.name)
         vpc = VPC.create(
                          self.apiclient,
@@ -785,6 +799,7 @@ class TestVPCOffering(cloudstackTestCase):
                          domainid=self.account.domainid
                          )
         self.validate_vpc_network(vpc)
+        self.cleanup.insert(0, vpc)
 
         gateway = vpc.cidr.split('/')[0]
         # Split the cidr to retrieve gateway
@@ -792,7 +807,7 @@ class TestVPCOffering(cloudstackTestCase):
         # Gateway = 10.0.0.1
 
         # Creating network using the network offering created
-        self.debug("Creating network with network offering: %s" %
+        self.logger.debug("Creating network with network offering: %s" %
                                                     self.network_offering.id)
         network = Network.create(
                                 self.apiclient,
@@ -804,7 +819,9 @@ class TestVPCOffering(cloudstackTestCase):
                                 gateway=gateway,
                                 vpcid=vpc.id
                                 )
-        self.debug("Deploying virtual machines in network: %s" % vpc.name)
+        self.logger.debug("Deploying virtual machines in network: %s" % vpc.name)
+        self.cleanup.insert(0, network)
+
         # Spawn an instance in that network
         virtual_machine = VirtualMachine.create(
                                   self.apiclient,
@@ -814,9 +831,10 @@ class TestVPCOffering(cloudstackTestCase):
                                   serviceofferingid=self.service_offering.id,
                                   networkids=[str(network.id)]
                                   )
-        self.debug("Deployed VM in network: %s" % network.id)
+        self.logger.debug("Deployed VM in network: %s" % network.id)
+        self.cleanup.insert(0, virtual_machine)
 
-        self.debug("Associating public IP for network: %s" % network.name)
+        self.logger.debug("Associating public IP for network: %s" % network.name)
         public_ip = PublicIPAddress.create(
                                 self.apiclient,
                                 accountid=self.account.name,
@@ -825,12 +843,12 @@ class TestVPCOffering(cloudstackTestCase):
                                 networkid=network.id,
                                 vpcid=vpc.id
                                 )
-        self.debug("Associated %s with network %s" % (
+        self.logger.debug("Associated %s with network %s" % (
                                         public_ip.ipaddress.ipaddress,
                                         network.id
                                         ))
 
-        self.debug("Trying to create NAT rule for the IP: %s" %
+        self.logger.debug("Trying to create NAT rule for the IP: %s" %
                                             public_ip.ipaddress.ipaddress)
         with self.assertRaises(Exception):
             NATRule.create(
@@ -850,7 +868,7 @@ class TestVPCOffering(cloudstackTestCase):
         # 1. Creating VPC Offering with services NOT supported by VPC
         #    like Firewall should not be allowed
 
-        self.debug("Creating a VPC offering with Firewall")
+        self.logger.debug("Creating a VPC offering with Firewall")
         self.services["vpc_offering"]["supportedservices"] = 'Dhcp,Dns,PortForwarding,Firewall,Vpn,SourceNat,Lb,UserData,StaticNat'
 
         with self.assertRaises(Exception):
@@ -859,7 +877,7 @@ class TestVPCOffering(cloudstackTestCase):
                                 self.services["vpc_offering"]
                              )
 
-        self.debug("Creating a VPC offering with only sourceNAT service")
+        self.logger.debug("Creating a VPC offering with only sourceNAT service")
         self.services["vpc_offering"]["supportedservices"] = 'SourceNat'
 
         try:
@@ -887,7 +905,7 @@ class TestVPCOffering(cloudstackTestCase):
         # 5. Change name and displaytext of the VPCOffering. Name and
         #    displaytext chnages should be reflected in listVPCPffering call
 
-        self.debug("Creating a VPC offering..")
+        self.logger.debug("Creating a VPC offering..")
         vpc_off = VpcOffering.create(
                                      self.apiclient,
                                      self.services["vpc_offering"]
@@ -896,10 +914,10 @@ class TestVPCOffering(cloudstackTestCase):
         self.cleanup.append(vpc_off)
         self.validate_vpc_offering(vpc_off)
 
-        self.debug("Enabling the VPC offering created")
+        self.logger.debug("Enabling the VPC offering created")
         vpc_off.update(self.apiclient, state='Disabled')
 
-        self.debug("creating a VPC network in the account: %s" %
+        self.logger.debug("creating a VPC network in the account: %s" %
                                                     self.account.name)
         with self.assertRaises(Exception):
             VPC.create(
@@ -910,11 +928,11 @@ class TestVPCOffering(cloudstackTestCase):
                          account=self.account.name,
                          domainid=self.account.domainid
                          )
-        self.debug("VPC network creation failed! (Test succeeded)")
-        self.debug("Enabling the VPC offering created")
+        self.logger.debug("VPC network creation failed! (Test succeeded)")
+        self.logger.debug("Enabling the VPC offering created")
         vpc_off.update(self.apiclient, state='Enabled')
 
-        self.debug("creating a VPC network in the account: %s" %
+        self.logger.debug("creating a VPC network in the account: %s" %
                                                     self.account.name)
         vpc = VPC.create(
                          self.apiclient,
@@ -926,7 +944,7 @@ class TestVPCOffering(cloudstackTestCase):
                          )
         self.validate_vpc_network(vpc)
 
-        self.debug("Updating name & display text of the vpc offering created")
+        self.logger.debug("Updating name & display text of the vpc offering created")
         new_name = random_gen()
         new_displaytext = random_gen()
 
@@ -939,7 +957,7 @@ class TestVPCOffering(cloudstackTestCase):
         except Exception as e:
             self.fail("Failed to update VPC offering- %s" % e)
 
-        self.debug("Cheking if the changes are reflected to listVPC call?")
+        self.logger.debug("Cheking if the changes are reflected to listVPC call?")
         vpc_offs = vpc_off.list(
                                 self.apiclient,
                                 id=vpc_off.id,
@@ -982,7 +1000,7 @@ class TestVPCOffering(cloudstackTestCase):
         # 8. All VPC offering in "Enabled" state should get listed.
         # 9. All VPC offering in "Disabled" state should get listed
 
-        self.debug("Creating multiple VPC offerings")
+        self.logger.debug("Creating multiple VPC offerings")
         self.services["vpc_offering"]["supportedservices"] = 'SourceNat'
 
         vpc_off_1 = VpcOffering.create(
@@ -991,7 +1009,7 @@ class TestVPCOffering(cloudstackTestCase):
                                      )
         self.cleanup.append(vpc_off_1)
         self.validate_vpc_offering(vpc_off_1)
-        self.debug("Disabling the VPC offering created")
+        self.logger.debug("Disabling the VPC offering created")
         vpc_off_1.update(self.apiclient, state='Disabled')
 
         vpc_off_2 = VpcOffering.create(
@@ -1001,7 +1019,7 @@ class TestVPCOffering(cloudstackTestCase):
 
         self.cleanup.append(vpc_off_2)
         self.validate_vpc_offering(vpc_off_2)
-        self.debug("Enabling the VPC offering created")
+        self.logger.debug("Enabling the VPC offering created")
         vpc_off_2.update(self.apiclient, state='Enabled')
 
         vpc_off_3 = VpcOffering.create(
@@ -1011,20 +1029,20 @@ class TestVPCOffering(cloudstackTestCase):
 
         self.cleanup.append(vpc_off_3)
         self.validate_vpc_offering(vpc_off_3)
-        self.debug("Enabling the VPC offering created")
+        self.logger.debug("Enabling the VPC offering created")
         vpc_off_3.update(self.apiclient, state='Enabled')
 
         vpc_off_4 = VpcOffering.create(
                                      self.apiclient,
                                      self.services["vpc_offering"]
                                      )
-        self.debug("Enabling the VPC offering created")
+        self.logger.debug("Enabling the VPC offering created")
         vpc_off_4.update(self.apiclient, state='Enabled')
 
-        self.debug("Deleting the VPC offering: %s" % vpc_off_4.name)
+        self.logger.debug("Deleting the VPC offering: %s" % vpc_off_4.name)
         vpc_off_4.delete(self.apiclient)
 
-        self.debug("Cheking if listVPCOff return the deleted VPC off")
+        self.logger.debug("Cheking if listVPCOff return the deleted VPC off")
         vpc_offs = VpcOffering.list(
                              self.apiclient,
                              id=vpc_off_4.id,
@@ -1036,10 +1054,10 @@ class TestVPCOffering(cloudstackTestCase):
                         "List VPC offerings should nt return any response for deleted offering"
                     )
 
-        self.debug("Validating the listVPCOfferings repsonse by ids")
+        self.logger.debug("Validating the listVPCOfferings repsonse by ids")
         self.validate_vpc_offering(vpc_off_3)
 
-        self.debug("ListVPCOfferings by displaytext & verifying the response")
+        self.logger.debug("ListVPCOfferings by displaytext & verifying the response")
         vpc_offs = VpcOffering.list(
                              self.apiclient,
                              displaytext=vpc_off_3.displaytext,
@@ -1057,7 +1075,7 @@ class TestVPCOffering(cloudstackTestCase):
                     "ListVPC Off with displaytext should return same VPC off"
                  )
 
-        self.debug("ListVPCOfferings by name and verifying the response")
+        self.logger.debug("ListVPCOfferings by name and verifying the response")
         vpc_offs = VpcOffering.list(
                              self.apiclient,
                              name=vpc_off_2.name,
@@ -1075,7 +1093,7 @@ class TestVPCOffering(cloudstackTestCase):
                     "ListVPC Off with name should return same VPC off"
                  )
 
-        self.debug(
+        self.logger.debug(
             "ListVPCOfferings by supported services & verifying the response")
         vpc_offs = VpcOffering.list(
                              self.apiclient,
@@ -1088,14 +1106,14 @@ class TestVPCOffering(cloudstackTestCase):
                          "List VPC offerings shall return a valid response"
                          )
         for vpc_off in vpc_offs:
-            self.debug(vpc_off)
+            self.logger.debug(vpc_off)
             self.assertEqual(
                     'SourceNat' in str(vpc_off),
                     True,
                     "ListVPC Off with name should return same VPC off"
                  )
 
-        self.debug("ListVPCOfferings by state & verifying the response")
+        self.logger.debug("ListVPCOfferings by state & verifying the response")
         vpc_offs = VpcOffering.list(
                              self.apiclient,
                              state='Enabled',
@@ -1113,7 +1131,7 @@ class TestVPCOffering(cloudstackTestCase):
                     "List VPC offering should return only offerings that are enabled"
                  )
 
-        self.debug("ListVPCOfferings by state & verifying the response")
+        self.logger.debug("ListVPCOfferings by state & verifying the response")
         vpc_offs = VpcOffering.list(
                              self.apiclient,
                              state='Disabled',
@@ -1135,21 +1153,21 @@ class TestVPCOffering(cloudstackTestCase):
     @attr(tags=["advanced", "redundancy"], required_hardware="false")
     def test_09_create_redundant_vpc_offering(self):
 
-        self.debug("Creating Redundant VPC offering")
+        self.logger.debug("Creating Redundant VPC offering")
         vpc_off = VpcOffering.create(
                                      self.apiclient,
                                      self.services["redundant_vpc_offering"]
                                      )
         self.cleanup.append(vpc_off)
 
-        self.debug("Check if the Redundant VPC offering is created successfully?")
+        self.logger.debug("Check if the Redundant VPC offering is created successfully?")
         self.validate_vpc_offering(vpc_off)
 
-        self.debug("Enabling the created Redundant VPC offering")
+        self.logger.debug("Enabling the created Redundant VPC offering")
         vpc_off.update(self.apiclient, state='Enabled')
 
 
-        self.debug("Creating a Redundant VPC network in the account: %s" %
+        self.logger.debug("Creating a Redundant VPC network in the account: %s" %
                                                     self.account.name)
         vpc = VPC.create(
                          self.apiclient,
@@ -1159,7 +1177,7 @@ class TestVPCOffering(cloudstackTestCase):
                          account=self.account.name,
                          domainid=self.account.domainid
                          )
-        self.debug("Validating Redundant VPC Nw creation")
+        self.logger.debug("Validating Redundant VPC Nw creation")
         self.validate_vpc_network(vpc)
 
         vpcs = VPC.list(


[5/6] git commit: updated refs/heads/master to b1c7d4b

Posted by re...@apache.org.
CLOUDSTACK-8935 - Filter the DNS list because it might contain 1 None entry which breaks the code.


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

Branch: refs/heads/master
Commit: a01720b25b301a5fd6eb3f8f8c7588727ac1aff7
Parents: 3ead9d7
Author: Wilder Rodrigues <wr...@schubergphilis.com>
Authored: Fri Oct 23 16:01:17 2015 +0200
Committer: Wilder Rodrigues <wr...@schubergphilis.com>
Committed: Fri Oct 23 16:45:36 2015 +0200

----------------------------------------------------------------------
 systemvm/patches/debian/config/opt/cloud/bin/cs/CsDhcp.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a01720b2/systemvm/patches/debian/config/opt/cloud/bin/cs/CsDhcp.py
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsDhcp.py b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsDhcp.py
index 6200d48..881cef2 100755
--- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsDhcp.py
+++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsDhcp.py
@@ -71,7 +71,8 @@ class CsDhcp(CsDataBag):
             # DNS search order
             if gn.get_dns() and device:
                 sline = "dhcp-option=tag:interface-%s,6" % device
-                line = "dhcp-option=tag:interface-%s,6,%s" % (device, ','.join(gn.get_dns()))
+                dns_list = [x for x in gn.get_dns() if x is not None]
+                line = "dhcp-option=tag:interface-%s,6,%s" % (device, ','.join(dns_list))
                 self.conf.search(sline, line)
             # Gateway
             gateway = ''


[3/6] git commit: updated refs/heads/master to b1c7d4b

Posted by re...@apache.org.
CLOUDSTACK-8935 - Do not retry 60 times when we expect the SSH to fail


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

Branch: refs/heads/master
Commit: 3eb6ba0699d1d768c78dee0da960ec0dc0dbf52f
Parents: 5ca32df
Author: Wilder Rodrigues <wr...@schubergphilis.com>
Authored: Fri Oct 23 15:59:03 2015 +0200
Committer: Wilder Rodrigues <wr...@schubergphilis.com>
Committed: Fri Oct 23 15:59:03 2015 +0200

----------------------------------------------------------------------
 test/integration/smoke/test_network.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3eb6ba06/test/integration/smoke/test_network.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_network.py b/test/integration/smoke/test_network.py
index 80a0932..05dd67a 100644
--- a/test/integration/smoke/test_network.py
+++ b/test/integration/smoke/test_network.py
@@ -432,7 +432,9 @@ class TestPortForwarding(cloudstackTestCase):
                 src_nat_ip_addr.ipaddress,
                 self.virtual_machine.ssh_port,
                 self.virtual_machine.username,
-                self.virtual_machine.password
+                self.virtual_machine.password,
+                retries=2,
+                delay=0
             )
         return
 
@@ -726,7 +728,8 @@ class TestRebootRouter(cloudstackTestCase):
                 self.public_ip.ipaddress.ipaddress,
                 self.services["natrule"]["publicport"],
                 self.vm_1.username,
-                self.vm_1.password
+                self.vm_1.password,
+                retries=5
             )
         except Exception as e:
             self.fail(


[2/6] git commit: updated refs/heads/master to b1c7d4b

Posted by re...@apache.org.
CLOUDSTACK-8935 - Check if the key is available in the dictionary

   - This will fix the cleanup problems.


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

Branch: refs/heads/master
Commit: 5ca32dfc8205a2847a274597c2e8fde36a85f624
Parents: 3725b3e
Author: Wilder Rodrigues <wr...@schubergphilis.com>
Authored: Thu Oct 22 14:52:07 2015 +0200
Committer: Wilder Rodrigues <wr...@schubergphilis.com>
Committed: Thu Oct 22 14:52:07 2015 +0200

----------------------------------------------------------------------
 systemvm/patches/debian/config/opt/cloud/bin/cs/CsGuestNetwork.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5ca32dfc/systemvm/patches/debian/config/opt/cloud/bin/cs/CsGuestNetwork.py
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsGuestNetwork.py b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsGuestNetwork.py
index 4010007..e1afb92 100755
--- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsGuestNetwork.py
+++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsGuestNetwork.py
@@ -39,7 +39,7 @@ class CsGuestNetwork:
         if not self.guest:
             return self.config.get_dns()
         # Can a router provide dhcp but not dns?
-        if 'dns' in self.data:
+        if 'dns' in self.data and 'router_guest_gateway' in self.data:
             return [self.data['router_guest_gateway']] + self.data['dns'].split(',')
         elif "router_guest_gateway" in self.data:
             return [self.data['router_guest_gateway']]