Result of running
$ pyupgrade --py38-plus $(git ls-files | grep ".py$")
This was inspired by Nova [1] and Octavia [2]
Fixed PEP8 errors introduced by pyupgrade by running:
$ autopep8 --select=E127,E128,E501 --max-line-length 79 -r \
--in-place designate
and manual updates.
[1]: https://review.opendev.org/c/openstack/nova/+/896986
[2]: https://review.opendev.org/c/openstack/octavia/+/899263
Change-Id: Idfa757d7ba238012db116fdb3e98cc7c5ff4b169
To better align with other OpenStack projects and to reduce the
ongoing problem with duplicate imports, this patch re-enables the
H306 check for proper module import order.
Change-Id: Iced92590829f6d9177d64ad4868aebe6eafd6a8a
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.
Fix problems found.
Update local hacking checks for new flake8.
# to unbreak gate:
Depends-on: https://review.opendev.org/715835
Change-Id: Icc2f4368cc90689d74510ce36fe77d2346aec625
TrivialFix: Similar [1] in Kolla project
As we known, Exceptions are raised by the sys.exit() function. When they
are not handled, no stack traceback is printed in the Python interpreter.
Therefore, when using sys.exit(main()) instead of main()
may be more readable and reasonable.
[1] https://review.openstack.org/#/c/349353/
Change-Id: Ied52a7631da82a72f0dcf2fc9ed81840d24041d9
String interpolation should be delayed to be handled by the
logging code, rather than being done at the point of the
logging call.
So we should use-
LOG.info(_LI('some message: variable=%s'), variable)
instead of
LOG.info(_LI('some message: variable=%s') % variable)
Reference: http://docs.openstack.org/developer/oslo.i18n/guidelines.html
Change-Id: I409358d9e35813f1875993b96fce86a0e2bc940b
H305: Imports not grouped correctly
H307: Like imports should be grouped together
Change-Id: Ic63d253e015298c7b952121a4b3634d2b1bdaf92
Implements: blueprint new-hacking-style-rules
Hacking package updated from '>=0.8.0,<0.9' to '>=0.9.2,<0.10'.
Many new style rules have been added, some of which Designate violates.
Only the style rules that pertain to I18n have been addressed.
The rest have been added to the ignore list in tox.ini for further review.
Change-Id: I5c559c491ff9bee2346b1589e7bb7e117137609b
Implements: blueprint standardize-logging
Closes-Bug: bug #1330540
zoneextractor.py helps on the client-side of the new zone
import API. It takes a BIND9 named.conf and writes out or prints a
zonefile for every configured master zone. Said zonefile can then be
curled or otherwise submitted to the zonefile import API.
Change-Id: Ibc15639771da52e678be067ec4474bcbcc2f0865