aquasecurity / kube-hunter

Hunt for security weaknesses in Kubernetes clusters
Apache License 2.0
4.7k stars 581 forks source link

Upgrade syntax for Python 3.6+ #401

Closed hugovk closed 3 years ago

hugovk commented 3 years ago

Description

Please include a summary of the change and which issue is fixed. Also include relevant motivation and context. List any dependencies that are required for this change.

The minimum version supported is Python 3.6, meaning the code can be upgraded to make use of newer syntax, and best of all: f-strings!

There's some other updates possible too, such as merged exceptions, simplifying super and class definitions for objects.

Contribution Guidelines

Please Read through the Contribution Guidelines.

Fixed Issues

Please mention any issues fixed in the PR by referencing it properly in the commit message. As per the convention, use appropriate keywords such as fixes, closes, resolves to automatically refer the issue. Please consult official github documentation for details.

Fixes https://github.com/aquasecurity/kube-hunter/issues/394

"BEFORE" and "AFTER" output

To verify that the change works as desired, please include an output of terminal before and after the changes under headings "BEFORE" and "AFTER".

BEFORE

Any Terminal Output Before Changes.

n/a

AFTER

Any Terminal Output Before Changes.

n/a

Contribution checklist

Notes

Please mention if you have not checked any of the above boxes.

codecov[bot] commented 3 years ago

Codecov Report

Merging #401 (542c7d2) into master (a476d93) will not change coverage. The diff coverage is 71.87%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #401   +/-   ##
=======================================
  Coverage   63.52%   63.52%           
=======================================
  Files          42       42           
  Lines        2289     2289           
=======================================
  Hits         1454     1454           
  Misses        835      835           
Impacted Files Coverage Δ
kube_hunter/modules/hunting/arp.py 46.87% <0.00%> (ø)
kube_hunter/modules/hunting/cves.py 78.09% <0.00%> (ø)
kube_hunter/modules/hunting/dns.py 37.77% <0.00%> (ø)
kube_hunter/modules/hunting/mounts.py 35.21% <0.00%> (ø)
kube_hunter/modules/report/plain.py 13.48% <0.00%> (ø)
kube_hunter/modules/discovery/hosts.py 62.50% <50.00%> (ø)
kube_hunter/modules/hunting/kubelet.py 60.00% <94.73%> (ø)
kube_hunter/core/events/handler.py 91.08% <100.00%> (ø)
kube_hunter/modules/hunting/apiserver.py 70.32% <100.00%> (ø)
kube_hunter/modules/hunting/certificates.py 93.33% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a476d93...542c7d2. Read the comment docs.

danielsagi commented 3 years ago

Thanks! great addition to kube-hunter! way to stay updated in the python field