CLOUDSTACK-10294: PEP-8 fixes and enhancements to security_group.py#2432
CLOUDSTACK-10294: PEP-8 fixes and enhancements to security_group.py#2432yadvr merged 8 commits intoapache:masterapache/cloudstack:masterfrom
Conversation
We should return a boolean and not a String 'true' or 'false' Although this output is never checked by the calling function(s). Signed-off-by: Wido den Hollander <wido@widodh.nl>
Do not use == False or == None as that is not according to the Python specs. Signed-off-by: Wido den Hollander <wido@widodh.nl>
Calling just print 'hello' is deprecated and won't work in neweer Python versions. We should use the print() function Signed-off-by: Wido den Hollander <wido@widodh.nl>
Signed-off-by: Wido den Hollander <wido@widodh.nl>
Signed-off-by: Wido den Hollander <wido@widodh.nl>
Signed-off-by: Wido den Hollander <wido@widodh.nl>
Signed-off-by: Wido den Hollander <wido@widodh.nl>
This is the Python way of executing commands Signed-off-by: Wido den Hollander <wido@widodh.nl>
borisstoyanov
left a comment
There was a problem hiding this comment.
LGTM based on code review
|
#BabySteps save the world LGTM |
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1703 |
|
We can merge this one, right? |
|
@wido let me kick a test round. |
|
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-2259)
|
borisstoyanov
left a comment
There was a problem hiding this comment.
Tests are looking good
|
@wido can you add a JIRA id for this? |
|
Done @rhtyd , updated the title with the issue: https://issues.apache.org/jira/browse/CLOUDSTACK-10294 |
In 6233a77 as a part of PR apache#2432 the bash() function was replaced by the execute() function. Somehow this last calling of the bash() function was not caught by testing and is still in there. This causes Exceptions to be thrown by the Security Group script. Signed-off-by: Wido den Hollander <wido@widodh.nl>
In 6233a77 as a part of PR apache#2432 the bash() function was replaced by the execute() function. Somehow this last calling of the bash() function was not caught by testing and is still in there. This causes Exceptions to be thrown by the Security Group script. Signed-off-by: Wido den Hollander <wido@widodh.nl>
…#2732) In 6233a77 as a part of PR #2432 the bash() function was replaced by the execute() function. Somehow this last calling of the bash() function was not caught by testing and is still in there. This causes Exceptions to be thrown by the Security Group script. Signed-off-by: Wido den Hollander <wido@widodh.nl>
…apache#2732) In 6233a77 as a part of PR apache#2432 the bash() function was replaced by the execute() function. Somehow this last calling of the bash() function was not caught by testing and is still in there. This causes Exceptions to be thrown by the Security Group script. Signed-off-by: Wido den Hollander <wido@widodh.nl>
|
Packaging result: ✖centos6 ✖centos7 ✖debian. JID-2613 |
The code in security_group.py is very old.
I looked into using Libvirt network filters for this, but it's lacking functionality we require.
This is my first attempt in cleaning up this file. There is a lot more work to do.
I tested this on a local system with Basic Networking and that worked just fine in my case.
The quality of the code is still horrible though:
A lot more work is needed, but I'm taking baby-steps so that it makes the review a bit easier and not one big bang with changes.