Commit Graph

18 Commits

Author SHA1 Message Date
Erik Olof Gunnar Andersson cc0431ba62 Standardize all configuration loading
There was a large config refactor many releases ago, but
we never standardized on the new pattern. This will also
help ensure that config is always loaded in the right order.

- Standardize how config is setup throughout designate.
- Removed unecessary import_opt.


Change-Id: I8913d2569f174208740a76c474c73316f6c1d89e
2023-11-03 11:19:11 +00:00
Erik Olof Gunnar Andersson 68fc28527a pyupgrade changes for Python3.8+
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
2023-11-03 11:19:07 +00:00
Manish Honap d193b0c70c Add option to force delete zone-files in delete API.
Designate does not delete the zone-files on the back-end when zone is
deleted. This results in thousands leftover zone files on backend e.g.
bind. Add option in designate zone delete API to force clean/delete
zone-files on the back-end. This option is restricted for admin or
owner roles.

Closes-Bug: 1966517
Change-Id: Ic7b8fee4d4702b0632774d32542b23d7d2a8c253
2022-10-20 10:01:23 +00:00
Michael Johnson 968e3d348d Remove netaddr module requirement
This patch removes the 'netaddr' module from the Designate requirements list.
It replaces the use of netaddr in Designate with the python standard library 'ipaddress' module.

Change-Id: I2fb1549e1d6cbccf58c03810c7d74c8c378682d5
2022-08-02 22:02:13 +00:00
Juan Pablo Suazo c230ddb8c5 Adds api_ca_cert configuration variable to pools.yaml
Adds a configuration variable that allows a user to
declare the CA certificate to be used to verify
traffic with a PowerDNS API endpoint.

Closes-Bug: #1971856
Signed-off-by: Juan Pablo Suazo <jsuazo@whitestack.com>
Change-Id: I57f3d5a1d1f79186cc5b38e76d30f62e01b60482
2022-05-13 11:21:47 -04:00
Erik Olof Gunnar Andersson 5d5d83e511 Remove deprecated and unused MDNS RPC calls
- Remove deprecated mdns notify option.

Change-Id: I91a05bda874658d8fdc051866fb49a5a97a00fe6
2022-05-05 19:17:51 +00:00
Michael Johnson 0e16095a80 Enable H306 check and fix import ordering
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
2021-11-18 00:30:05 +00:00
wangzihao 88a4be5e5c Remove six
Remove six Replace the following items with Python 3 style code.

- six.PY3
- six.moves.urllib
- six.PY2
- six.text_type
- six.string_types
- six.iterkeys
- six.moves.range
- six.add_metaclass
- six.moves.map
- six.moves.zip
- six.MAXSIZE

Change-Id: I4cd26693fac7c16f4fa3d3c0015cd7af796f0877
2021-06-22 06:41:24 +00:00
Andrew Bogott 5acba9443e pdns4 backend: check if zone exists before attempting delete
This should prevent us from obsessing over zones that are in the
designate DB but not in the pdns backend due to races/incomplete
transactions/etc.

Bug: 1880230
Change-Id: I00ae6227edf21007c39a7d55221898ae5c10dda2
2020-06-02 11:03:21 -05:00
Andreas Jaeger 2e3d8ab80d Update hacking for Python3
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
2020-04-01 21:52:38 +00:00
Erik Olof Gunnar Andersson 2ad08a6a05 Fix ipv6 bugs with devstack and pdns4 driver
* Change dns backends and pools.yaml to use
  ipv6 addresses not wrapped in brackets.

* Changed MySQL backends to use MYSQL_HOST.

* Fixed bug in pdns4 driver not allowing
  masters to use an ipv6 address.

Depends-On: https://review.opendev.org/#/c/678324/
Change-Id: I8f469e732618732f5417c1b5e6c2049eaa83ea78
2019-08-29 08:12:38 -07:00
Erik Olof Gunnar Andersson 2c7b8476b4 Lazy-load PowerDNS 4 logs + cleaned up tests
This commit converts all pdns4 logs to be lazy-loaded,
and does some minor clean up on the tests.

Change-Id: I668cac1488d22a1a22c4ea84220db8e99176efc6
2019-05-21 09:35:08 -07:00
Zuul 74e46c784f Merge "Update Driver statuses" 2019-05-20 04:18:21 +00:00
Graham Hayes 9512ef1980
Ensure pdns4 driver is consistent with other drivers
Other drivers will delete and / or overwrite zones that pre-exist on a server.
Updates the pdns4 driver to act the same way, and also clean up zones
that were not created properly.

Also send a notify immedidiately after creation to force a sync from the pdns
server, instead of waiting for the timer to trigger the first transfer.

Change-Id: I59fe82220adef4b28d4621e093064ee971e1dea8
Signed-off-by: Graham Hayes <gr@ham.ie>
2019-05-03 10:53:52 -06:00
Graham Hayes 3fbd9dea9d
Update Driver statuses
Change-Id: Iac78b8668bcdca34bf354d6feab3e9547ba2c71f
Signed-off-by: Graham Hayes <gr@ham.ie>
2019-04-01 15:03:09 +01:00
Graham Hayes 7a1ba8ee9b Allow pdns4 backend to select tsigkey
Allow a new config item in pools.yaml to set the pdns tsigkey to use for
AFXR queries.

Change-Id: Ibb4fb604957286c6edfe85f72321f199eb3167a7
Closes-Bug: #1820089
Signed-off-by: Graham Hayes <gr@ham.ie>
2019-03-22 09:11:41 +00:00
Monty Taylor 7f4a9a65ea Add SOA to RECORD_TYPES in sqlalchemy.tables and remove eventlet constraint
sqlalchemy 1.1 is more strict on enum values. Because of that, the fact
that the two RECORD_TYPES enums are out of sync makes things sad.

This patch also pin eventlet version to 0.19.0 since eventlet >=0.20.0 in
upper constraint still make UT fail.

Co-Authored-By: Hieu LE <hieulq@vn.fujitsu.com>
Change-Id: I4de68749e9eddbddbc7f8d8df68ce3ea71cc4fcb
2017-04-24 17:16:18 +00:00
Graham Hayes aa23d86835 Add PowerDNS 4 driver
Fixes-Bug: #1590429

Change-Id: I1f6017ce83a49dc0c3827c540ac18186bb14f72b
2016-09-16 17:33:13 +01:00