Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id C410F200B35 for ; Tue, 5 Jul 2016 15:53:36 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C27D2160A60; Tue, 5 Jul 2016 13:53:36 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 3D8A3160A2C for ; Tue, 5 Jul 2016 15:53:36 +0200 (CEST) Received: (qmail 11856 invoked by uid 500); 5 Jul 2016 13:53:35 -0000 Mailing-List: contact dev-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list dev@cloudstack.apache.org Received: (qmail 11843 invoked by uid 99); 5 Jul 2016 13:53:35 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Jul 2016 13:53:35 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D875AE01C1; Tue, 5 Jul 2016 13:53:34 +0000 (UTC) From: The-Loeki To: dev@cloudstack.apache.org Reply-To: dev@cloudstack.apache.org References: In-Reply-To: Subject: [GitHub] cloudstack issue #1603: Vrouter fixes pylint Content-Type: text/plain Message-Id: <20160705135334.D875AE01C1@git1-us-west.apache.org> Date: Tue, 5 Jul 2016 13:53:34 +0000 (UTC) archived-at: Tue, 05 Jul 2016 13:53:36 -0000 Github user The-Loeki commented on the issue: https://github.com/apache/cloudstack/pull/1603 kudos for all the hard work! Most of this should've been done a long time ago as `pylint` is one of the first firewalls of code quality ensurance. Side notes: * no fan of `%s` syntax; recommend further refactoring to employ `.format()` which should make the code a lot more elegant. * Strings oughta be single-quoted unless double quotes are necessary e.g.: ``` - self.fw.append( - ["nat", "", - "-I PREROUTING -i ppp+ -m tcp --dport 53 -j DNAT --to-destination %s" % - local_ip - ] - ) + self.fw.append([ + 'nat', '', + '-I PREROUTING -i ppp+ -m tcp --dport 53 -j DNAT --to-destination {}'.format( + local_ip + )]) ``` --- 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. ---