4710 Commits

Author SHA1 Message Date
Erik Olof Gunnar Andersson
e65b32a6e6 Clean up manage pools and add additional testing
Change-Id: I6bfe074ec9db9bd95021771b8ffe988f1f23e2be
2022-08-22 21:19:13 -07:00
OpenStack Proposal Bot
4a34f43e52 Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: Ib83f5e1cde009b740ccf01a027bd96bed17c0e97
2022-08-23 03:33:00 +00:00
OpenStack Proposal Bot
925ec43db5 Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: I048f35e7813eb4e2f2b6e4f5259dd4fb2eb3198e
2022-08-22 03:51:54 +00:00
Michael Johnson
a03c4657c2 Fix designate-manage pool update MissingProjectID
This patch fixes a bug where adding an additional pool to designate using the "designate-manage pool update" command may fail with an exception:

designate.exceptions.MissingProjectID: A project ID must be specified when not using a project scoped token.

There was an extra check added as part of the scoped token work that a project ID must be provided when creating pools. This was incorrect as pools are still valid with a None project ID as they are a system resource and not tied to a specific project.

This patch removes that check, but retains the RBAC check for and "admin" token.

Closes-Bug: #1986733
Change-Id: I7345d7ef505420767209ba037e3c8930a282d03f
2022-08-16 22:22:19 +00:00
Erik Olof Gunnar Andersson
f237b0a63c Add additional backend tests
Change-Id: I5dca5495e1d4510682b6244d2e7ca707308927d8
2022-08-15 22:35:42 -07:00
Zuul
927e34ee5a Merge "Add basic get backend test" 2022-08-16 01:39:33 +00:00
Zuul
3c6b84154d Merge "Add basic test for disabling the api" 2022-08-16 01:18:52 +00:00
Zuul
e68640d611 Merge "Add basic quotas api tests" 2022-08-15 23:57:34 +00:00
kpdev
536315e38c Validate MX records during recordset create or update
If invalid MX record is provided during recordset create command or
valid record is updated to invalid record using recordset set command,
causes recordset creation/updation failure. This leads to zone enter
in ERROR state and all further recordset creation calls fail. Validate
the records within recordset during create or update call.

Closes-Bug: #1927304
Change-Id: I0ace4d6c4ad6a6ee236e3af23805b01345d60a42
2022-08-15 07:41:34 +00:00
Erik Olof Gunnar Andersson
6b1f99167b Add basic test for disabling the api
Change-Id: I0f6d3440e5b352770fe7da1808038c9b60ce8e23
2022-08-13 18:45:49 -07:00
Erik Olof Gunnar Andersson
f46d9de45f Add basic quotas api tests
- Changed tenant_id to project_id.
- Fixed some minor style issues with api tests.

Change-Id: Ia53c39cd78e42b82b380f8c957747d14078dff25
2022-08-13 14:09:59 -07:00
Erik Olof Gunnar Andersson
3e6157f78f Add basic get backend test
- Removed unused start/stop functions

Change-Id: I38ebf73859498acb0c86a4e1f48e92ce371389b8
2022-08-13 13:23:52 -07:00
Zuul
63563a5098 Merge "Simplified backend unit tests" 2022-08-13 02:12:27 +00:00
Zuul
ae3ed981ac Merge "Add a user guide for Neutron/Nova DNS integration" 2022-08-11 07:25:21 +00:00
Erik Olof Gunnar Andersson
43428e48d0 Simplified backend unit tests
These tests have no dependencies on the Designate Test class
and by moving to the oslo test base class instead we reduce the
runtime of these tests from ~5s to ~150ms.

- Added some basic tests for the fake backend (aka noop)
- Switched from designate.tests.TestCase to oslotest.base.BaseTestCase

Change-Id: I5d78939eb43476e6c93235e131086bc8537b0e03
2022-08-10 22:49:13 -07:00
Takashi Kajinami
16eba621b7 Sync rootwrap.conf from oslo.rootwrap
The current rootwrap.conf file is outdated and doesn't include some
parameters. This change updates the content to make it consistent with
the latest example file in oslo.rootwrap.

Change-Id: I5fe06cf99bb9787ec3afc67ab60a7330fe281513
2022-08-11 05:04:16 +00:00
Zuul
f3c29e8bce Merge "Fixed issues with __repr__ and __str__ on objects" 2022-08-10 07:05:22 +00:00
Zuul
7f87a8fa4f Merge "Remove netaddr module requirement" 2022-08-08 18:13:42 +00:00
Erik Olof Gunnar Andersson
fe387ae91b Fixed issues with __repr__ and __str__ on objects
We are currently override __repr__ in our base VersionedObject
and removing some useful information when debugging.

- Re-wrote __str__ to not raise an exception if data is missing.
- Removed some unused _to_string functions.
- Changed _from_string to from_string.

Change-Id: Idfd6c959cf943c5aaf95746f16070000bf82ca21
2022-08-07 17:28:38 +00:00
Erik Olof Gunnar Andersson
8beccabe4e Added additional test coverage for adapters
- Removed uncessary log line in base adapter.

Change-Id: I6e1a74fa3ecca0f82735ba36ac4336ab6cdeb56e
2022-08-06 03:28:23 +00:00
Michael Johnson
60c378763a Switch Designate to Alembic database migrations
Currently Designate is using sqlalchemy-migrate for database schema
migrations. sqlalchemy-migrate/migrate have been deprecated for some
time. This patch moves switches Designate to use Alembic for database
migrations.

Change-Id: I90ecb4d409b8b609b384997fa4cc9c65755409b3
2022-08-04 17:15:09 +00:00
Zuul
ef187ddec8 Merge "Re-factored central and rpc decorators" 2022-08-04 00:08:54 +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
Erik Olof Gunnar Andersson
857b4c4e63 Re-factored central and rpc decorators
- Moved central and rpc decorators to common location.
- Cleaned up decorator code.

Change-Id: I79d21df7d17a2f706b8747e600e79a1ef1762e2b
2022-07-30 22:14:27 -07:00
OpenStack Proposal Bot
9876b7b935 Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: Id366a2d2b40367ada2aa5b1e3cc9ef615967216e
2022-07-28 03:02:32 +00:00
Zuul
d58514ec84 Merge "Replace deprecated readfp method with read_file" 2022-07-25 18:58:50 +00:00
Zuul
3aaade3b3c Merge "Fix sqlalchemy table_names DeprecationWarning" 2022-07-23 01:31:47 +00:00
Zuul
f4712396cb Merge "Fix pecan lookup_controller DeprecationWarning" 2022-07-23 01:31:45 +00:00
Zuul
d9eec803ca Merge "Enable cache_ok on custom sqlalchemy UUID type" 2022-07-23 01:31:43 +00:00
Michael Johnson
2fc736c627 Add a user guide for Neutron/Nova DNS integration
This patch adds a user guide that describes how to use the Neutron/Nova integration with Designate. It provides examples for Nova instance, Neutron ports and floating IPs.

Previously this information was split across Nova, Neutron, and Designate documentation.

This patch also adds a "references" section to the documentation and adds a glossary document to help explain some of our terms.

Change-Id: I2bcf4b7052e12801b95dd3a541d1e8535c82c17c
2022-07-22 22:50:24 +00:00
ljhuang
0a3959d155 Replace deprecated readfp method with read_file
The readfp method has been deprecated since version 3.2 [1].

[1] https://docs.python.org/3/library/configparser.html?highlight=deprecated#configparser.ConfigParser.readfp

Change-Id: Ib4d13e850e47c80ca6ec601b9e195337d9a403e0
2022-07-22 17:21:43 +08:00
Michael Johnson
12e42df744 Fix sqlalchemy table_names DeprecationWarning
This patch updates Designate to use the new method of getting the table names from a sqlalchemy engine. It replaces the use of tables_names() with get_table_names from the sqlalchemy inspector.
The DeprecationWarning was:
SADeprecationWarning: The Engine.table_names() method is deprecated and will be removed in a future release.  Please refer to Inspector.get_table_names(). (deprecated since: 1.4)
  self.assertEqual(table_names, self.storage.engine.table_names())

Change-Id: I99d01a552d24123681e11f746c2e1195634efbfd
2022-07-21 23:15:17 +00:00
Michael Johnson
e045483500 Fix pecan lookup_controller DeprecationWarning
This patch updates Designate for the new funtion signature on pecan
lookup_controller to include the request information if available.

This corrects the following warning we were seeing in Designate:
DeprecationWarning: The function signature for pecan.routing.lookup_controller is changing in the next version of pecan.
Please update to: `lookup_controller(self, obj, remainder, request)`.

Change-Id: Icb206e59c83eec984599d48b3d4719c36eb83734
2022-07-21 21:25:17 +00:00
Michael Johnson
3afd9a02fb Enable cache_ok on custom sqlalchemy UUID type
This patch adds the "cache_ok = True" to the custom sqlalchemy UUID type in designate.
It resolves the warning:
designate/sqlalchemy/base.py:243: SAWarning: TypeDecorator UUID() will not produce a cache key because the ``cache_ok`` attribute is not set to True.  This can have significant performance implications including some performance degradations in comparison to prior SQLAlchemy versions.  Set this attribute to True if this type object's state is safe to use in a cache key, or False to disable this warning. (Background on this error at: https://sqlalche.me/e/14/cprf)

Change-Id: Ic3aca3836b331db495109f6b6672e5c8af1d4028
2022-07-21 17:51:45 +00:00
Erik Olof Gunnar Andersson
d10056178a Cleaned up and fixed record objects and tests
We are currently raising the wrong exceptions for a few record
types. This can cause only part of the failures to get raised
to the user, since the first exception will fail the process.
Ideally we want to inform the user of all invalid records.

This patch fixes this and cleans up some of code as well.
- Cleaned up objects to use consistent exceptions.
- Fixed all broken tests.
- Re-named various objects tests.

Change-Id: I3d54a47f73929377122249c4d971e70e553725a6
2022-07-20 21:39:45 -07:00
Zuul
3423a3e656 Merge "Validate matching double quotes in TXT recordsets." 2022-07-20 23:13:49 +00:00
Manish Honap
7f428e8ab5 Validate matching double quotes in TXT recordsets.
Currently, designate does not validate that if a TXT recordset starts
with a double quote, it also ends with a double quote. So, if user has
provided TXT record in this unmatched doublequote format, zone ends up
in error.

This change verifies that if a TXT record starts with a double quote,
it also ends with a double quote.

Closes-Bug: 1980757
Change-Id: I75bd7c1657a9178c8e7ef2d66fa7318255c67582
2022-07-19 23:52:41 +05:30
Zuul
ad3bdad7b7 Merge "Remove logic for Python < 3.2" 2022-07-19 16:40:58 +00:00
Erik Olof Gunnar Andersson
8abb3117af Cleaned up adapter code
- Changed name of variables shadowing in-built names.
- Removed unecessary newlines.

Change-Id: I4ce767bd9d231efb09375bd42daa1c9589b46cf8
2022-07-17 20:51:07 -07:00
Takashi Kajinami
f616bd45a4 Remove logic for Python < 3.2
Change-Id: If9d4dc59d6663716ac0da61b2a6e3cde7f100e86
2022-07-17 00:21:27 +09:00
Zuul
9a43b91cf3 Merge "Added basic service unit tests" 2022-07-15 03:18:17 +00:00
Zuul
759da10211 Merge "Updated dns message code and tests" 2022-07-15 03:03:55 +00:00
Zuul
806bbb17c9 Merge "Added additional wsgi app testing" 2022-07-14 22:33:28 +00:00
Erik Olof Gunnar Andersson
a5db847f21 Added additional wsgi app testing
Change-Id: I4ec8f269fe43fcc58a5a8cff8ec250af0f486033
2022-07-12 18:49:59 -07:00
Erik Olof Gunnar Andersson
8140294c73 Updated dns message code and tests
- Added additional dns tests.
- Split unit and functional tests into separate files.
- Cleaned up duplicate dns message functions.
- Updated dns function comments and naming.

Change-Id: I913dab094d5c86736a030848ce1bba29736ff835
2022-07-09 04:47:26 +00:00
Erik Olof Gunnar Andersson
463e1fda30 Added basic service unit tests
- Removed unused override_endpoints function.

Change-Id: I5f46c05dffd8dfcb9235c993527b340c8e83d8de
2022-07-09 02:05:08 +00:00
dkehn
cc660ca021 Minmum TTL value is zero
According to IETF https://tools.ietf.org/html/rfc2181#section-8 the
definition of the ttl value is unsigned and can have a minimum
value of 0. This path changes the minimum value of 1 to allow for
0 in recordset creats and updates. Unit test have also been modified
accordingly.

Closes-Bug: #1926429
Change-Id: I9b08e25a007bea598442da377dc227538f6e35f7
2022-07-07 11:02:21 +00:00
Michael Johnson
39652d7a51 Add simple API versioning to the Designate API
Adds simple API versioning for Designate. Designate API minor releases are
additive to the API major revision and share the same URL path. Subsequent
minor versions are a superset of the previous versions of the same major
revision.
Updates the version discovery document to be compliant with OpenStack
version discovery.
Restructures the API reference to provide more information about the
versioning.

Depends-On: https://review.opendev.org/c/openstack/designate-tempest-plugin/+/848323
Change-Id: I13162711b521472ec8b796ced34d0b7107aaed36
2022-06-30 18:30:54 +00:00
Zuul
d05232fc07 Merge "Removed RPC calls from MDNS and moved them to the Worker" 2022-06-25 05:58:17 +00:00
Zuul
966ad7a0d3 Merge "Update requirements for oslo.context>=4.0.0" 2022-06-25 02:41:23 +00:00