Github user jburwell commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1578#discussion_r77756322 --- Diff: test/integration/plugins/nuagevsp/nuageTestCase.py --- @@ -360,60 +427,75 @@ def delete_VM(self, vm, expunge=True): # get_Router - Returns router for the given network def get_Router(self, network): - self.debug("Finding the virtual router for network with ID - %s" % network.id) + self.debug("Finding the virtual router for network with ID - %s" % + network.id) routers = Router.list(self.api_client, networkid=network.id, listall=True ) self.assertEqual(isinstance(routers, list), True, - "List routers should return a valid virtual router for network" + "List routers should return a valid virtual router " + "for network" ) return routers[0] - # acquire_PublicIPAddress - Acquires public IP address for the given network/VPC + # acquire_PublicIPAddress - Acquires public IP address for the given + # network/VPC def acquire_PublicIPAddress(self, network, vpc=None, account=None): if not account: account = self.account - self.debug("Associating public IP for network with ID - %s in the account - %s" % (network.id, account.name)) + self.debug("Associating public IP for network with ID - %s in the " + "account - %s" % (network.id, account.name)) public_ip = PublicIPAddress.create(self.api_client, accountid=account.name, domainid=account.domainid, zoneid=self.zone.id, - networkid=network.id if vpc is None else None, - vpcid=vpc.id if vpc else self.vpc.id if hasattr(self, "vpc") else None + networkid=network.id + if vpc is None else None, + vpcid=vpc.id if vpc else self.vpc.id + if hasattr(self, "vpc") else None ) - self.debug("Associated public IP address - %s with network with ID - %s" % - (public_ip.ipaddress.ipaddress, network.id)) + self.debug("Associated public IP address - %s with network with ID - " + "%s" % (public_ip.ipaddress.ipaddress, network.id)) return public_ip - # create_StaticNatRule_For_VM - Creates Static NAT rule on the given public IP for the given VM in the given network - def create_StaticNatRule_For_VM(self, vm, public_ip, network, vmguestip=None): - self.debug("Enabling Static NAT rule on public IP - %s for VM with ID - %s in network with ID - %s" % + # create_StaticNatRule_For_VM - Creates Static NAT rule on the given + # public IP for the given VM in the given network + def create_StaticNatRule_For_VM(self, vm, public_ip, network, + vmguestip=None): + self.debug("Enabling Static NAT rule on public IP - %s for VM with ID " + "- %s in network with ID - %s" % (public_ip.ipaddress.ipaddress, vm.id, network.id)) - static_nat_rule = StaticNATRule.enable(self.api_client, - ipaddressid=public_ip.ipaddress.id, - virtualmachineid=vm.id, - networkid=network.id, - vmguestip=vmguestip - ) - self.debug("Static NAT rule enabled on public IP - %s for VM with ID - %s in network with ID - %s" % + static_nat_rule = StaticNATRule.enable( + self.api_client, + ipaddressid=public_ip.ipaddress.id, + virtualmachineid=vm.id, + networkid=network.id, + vmguestip=vmguestip + ) --- End diff -- Please add assertions to validate that ``static_nat_rule`` was enabled as expected.
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---