cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jburwell <...@git.apache.org>
Subject [GitHub] cloudstack pull request #1578: CLOUDSTACK-9401 : Support for Internal DNS in...
Date Wed, 07 Sep 2016 03:43:27 GMT
Github user jburwell commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1578#discussion_r77756212
  
    --- Diff: test/integration/plugins/nuagevsp/nuageTestCase.py ---
    @@ -175,45 +234,44 @@ def tearDown(self):
             return
     
         # create_VpcOffering - Creates VPC offering
    -    def create_VpcOffering(self, vpc_offering, suffix=None):
    -        self.debug("Creating VPC offering")
    +    @needscleanup
    +    def create_VpcOffering(cls, vpc_offering, suffix=None):
    +        cls.debug("Creating VPC offering")
             if suffix:
                 vpc_offering["name"] = "VPC_OFF-" + str(suffix)
    -        vpc_off = VpcOffering.create(self.api_client,
    +        vpc_off = VpcOffering.create(cls.api_client,
                                          vpc_offering
                                          )
             # Enable VPC offering
    -        vpc_off.update(self.api_client, state="Enabled")
    -        self.cleanup.append(vpc_off)
    -        self.debug("Created and Enabled VPC offering")
    +        vpc_off.update(cls.api_client, state="Enabled")
    +        cls.debug("Created and Enabled VPC offering")
             return vpc_off
     
         # create_Vpc - Creates VPC with the given VPC offering
    -    def create_Vpc(self, vpc_offering, cidr='10.1.0.0/16', testdata=None, account=None,
networkDomain=None,
    -                   cleanup=True):
    +    @needscleanup
    +    def create_Vpc(cls, vpc_offering, cidr='10.1.0.0/16', testdata=None,
    +                   account=None, networkDomain=None):
             if not account:
    -            account = self.account
    -        self.debug("Creating a VPC in the account - %s" % account.name)
    +            account = cls.account
    +        cls.debug("Creating a VPC in the account - %s" % account.name)
             if not testdata:
    -            testdata = self.test_data["vpc"]
    +            testdata = cls.test_data["vpc"]
                 testdata["name"] = "TestVPC-" + cidr + "-" + str(vpc_offering.name)
                 testdata["displaytext"] = "Test VPC"
                 testdata["cidr"] = cidr
    -        vpc = VPC.create(self.api_client,
    +        vpc = VPC.create(cls.api_client,
                              testdata,
                              vpcofferingid=vpc_offering.id,
    -                         zoneid=self.zone.id,
    +                         zoneid=cls.zone.id,
                              account=account.name,
                              domainid=account.domainid,
                              networkDomain=networkDomain
                              )
    -        self.debug("Created VPC with ID - %s" % vpc.id)
    -        if cleanup:
    -            self.cleanup.append(vpc)
    +        cls.debug("Created VPC with ID - %s" % vpc.id)
             return vpc
     
         # restart_Vpc - Restarts the given VPC with/without cleanup
    -    def restart_Vpc(self, vpc, cleanup=None):
    +    def restart_Vpc(self, vpc, cleanup=False):
    --- End diff --
    
    Flag arguments are an anti-pattern.  Please consider refactoring to another method such
as ``restartVpcWithCleanup``.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message