cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From The-Loeki <...@git.apache.org>
Subject [GitHub] cloudstack issue #1603: Vrouter fixes pylint
Date Tue, 05 Jul 2016 13:53:34 GMT
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.
---

Mime
View raw message