- Moved all functional tests to dedicated folder.
- Updated a few tests to use faster oslo tests.
- Renamed fixtures.py to base_fixtures.py.
Change-Id: Ie8c5591dd12a91350173bec2b418b6c9ddea79fe
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
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
We have a lot of abstraction that isn't really needed. This patch
removes some of that abstraction and reorganizes the code accordingly.
- Merged storage and sqlalchemy folders.
- Deprecated [central].storage_driver.
- Minor cleanup to SQL code.
- Cleaned up comments and unit tests.
Change-Id: I8f0508aedcc028b1a6e74c790c5d757a0d6c98d7
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
This patch improves the quotas API validations and test coverage. Invalid quota settings will now be caught at the API/Central layer and not down in the storage layer(DB).
Depends-On: https://review.opendev.org/c/openstack/designate-tempest-plugin/+/842238
Closes-Bug: #1934596
Change-Id: I474bdd988a6cc3a9bcce1b65c2f49216dd85addf
*) Add osprofiler wsgi middleware
This middleware is used for 2 things:
1) It checks that person who want to trace is trusted and knows
secret HMAC key.
2) It start tracing in case of proper trace headers and add
first wsgi trace point, with info about HTTP request
*) Add initialization of osprofiler at start of serivce.
You should use python-designateclient with this patch:
https://review.opendev.org/#/c/773575
Run any command with --os-profile SECRET_KEY
$ openstack zone create --email <email_id> <zone_name> \
--os-profile SECRET_KEY
# it will print <Trace ID>
Get pretty HTML with traces:
$ osprofiler trace show --html <Trace ID> --connection-string \
<connection_string> --out <output.html>
e.g. --connection-string can be redis://localhost:6379
Note that osprofiler should be run from admin user name & tenant.
Implements: blueprint designate-os-profiler
Change-Id: I2a3787b6428d679555a9add3a57ffe8c2112b6d3
This fixes a race-condition when creating multiple PTR records
under the same zone. There is a brief window when creating two
identical zones can cause an error. This adds a fallback that
should prevent the error.
I also added a threaded test that caught multiple additional
bugs in this code.
- Wrong find_recordset used caused the wrong exception to be thrown.
- The transaction workflow would break error handling.
Change-Id: Ia1194ab838c52d5d91cb1d26c4556c73b4f3a745
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
DeprecationWarning: inspect.getargspec() is deprecated since
Python 3.0, use inspect.signature() or inspect.getfullargspec()
Change-Id: I3707546e77acb9dec56ec33cbabb3e6228525f9c
The use of this code path is very limited at the moment,
and this patch further simplifies the code to make it easier
to either deprecate or extend it in the future.
* Renamed service_status.py -> heartbeat_emitter.py.
* Merged HeartbeatEmitter and Heartbeat.
Change-Id: I68a4a49dd3e6bbc123c3ed5d3d3661aa08ad0bbb
The pool-manager has been deprecated since Newton and
is now being removed with the Train release.
Change-Id: Ib258043d492bb25e1c061d765b40885317c73804
This patch removes get_cfg_opts from the plugin class,
and moves all configuration directly into designate.conf.
There are no changes in the generated configuration due
to this patch.
Finally, this complets the blueprint to centralize all
configuration, and is a follow up to this patch
I3be68bf294157631a9bac128df0841220020de96
blueprint centralize-config-designate
Change-Id: I007fc004fc533950c5eda3974f41f05c6db5b43f
Fixed a bunch of deprecated warnings from oslo.context.
* Use project_id instead of tenant.
* Use user_id, domain_id etc.
Change-Id: I6e8affbabeca4162f11fb4ba47ffa2e960103ccd
Based upon the established conf paradigm used in Nova,
this patch moves most of the configuration to a
central location. Making config a lot easier to
manage, as well a lot easier to locate.
There is still some configuration listed in classes,
that I would like to eventually move to
designate.conf as well, but to lower complexity not
all config was moved.
General changes
* Centrelized most configuration under designate.conf.
* Cleaned up configuration.
* Simplified config generation.
* Renamed generated config to designate.conf.sample.
Previously broken
* xfr_timeout now in the appropriate section.
* memcached_servers now in the appropriate section.
Previously missing from sample config
* allowed_remote_exmods listed in sample config.
* backend:akamai section listed in sample config.
* backend:dynect section listed in sample config.
* backend:infoblox section listed in sample config.
blueprint centralize-config-designate
Change-Id: I3be68bf294157631a9bac128df0841220020de96
oslo_messaging's rpc_backend setting, which is set by
ConfFixture.transport_driver has been deprecated since Newton. To allow
oslo_messaging to remove it, switch to setting transport_url instead.
Change-Id: I56ed0952f667dc51fb36aa1e85875e2d30097237
Partial-Bug: #1712399
In the current implementation, if for any reason a duplicate
service entry gets created, the call to update that service
will fail endlessly, and instead cause the service to create
new entries everytime update_service_status gets called. Causing
it to fill the database with duplicate entries.
This patch adds a unique constraint to the service_statuses
table based on the service_name and hostname, to ensure that
this cannot happen.
In addition we add a new test to the storage driver and further
expanded the central service test coverage.
Change-Id: I307a8f7dd8b8a83effa447a846db3288efa32dba
Closes-Bug: #1768824
The tests try to configure oslo messaging notifications to use the
"test" driver, but it needs a list, not a single value. You can see the
warning in the logs:
WARNING [stevedore.named] Could not load s, e, t
This properly declare the driver as a single item list.
Change-Id: Ia0b57580c00fe0f7b9c0a19ac5190282972f624f
This patch refactor NSD4 UT by mocking out instead of using eventlet
for fake NSD4 backend.
This patch also remove pinned eventlet version and use upper constraint
of eventlet for UT.
Closes-Bug: 1686601
Change-Id: Iabc7fe6a1f6932959f4531a333bcbd1ad6f06e4f
Prevent a warning message from SQLAlchemy when formatted_ids is empty
Minor unit test unicode cleanup
Change-Id: Ic4f872c314c472554129c0608090f0dd9f715ae1
Earlier on REST API call to zones/tasks/imports or zones/tasks/exports,
metadata field was displayed with no key/val pair.
This patch makes {'total_count : #val'} to be be produced as
output in metadata field on execution of those REST API call.
Closes-Bug: #1532925
Change-Id: I566e370edce5f29aafe793d5fdf7fe2fb7b3a856
This change adds the tooling to use the DB Tables created for pool
config data and the tooling to migrate the config info itself.
Change-Id: If99dbf527ef1ac0f05f15fe77f68f64e357fe0a5
This change adds the new pools DB tables and access code,
but does not make use of or populate the new tables.
Change-Id: I71232bc0087b53b6678295d7900916ec51e0cb2b
Our testrepository.subunit was over 50Mb on a recent change
If we need that output:
export DESIGNATE_SQL_DEBUG=True
tox
Change-Id: I56d5cb5390ca83311484d72ae5677d3fbf944edb
This is a pretty invasive change :)
A non complete list of changes:
* Database Tables
* Database Columns
* Designate Objects and fields on Objects
* Designate Objects Adaptors stop doing some of the renames
* All RPCAPI versions are bumped - totally backward
incompatable (function names have changed)
Change-Id: Ib99e918998a3909fa4aa92bf1ee0475f8a519196
assertEqual expects that the arguments provided to it should be
(expected, observed). If a particular order is kept as a convention,
then it helps to provide a cleaner message to the developer if Unit Tests
fail. There are several Unit Test files where the arguments for assertEqual
have been swapped.
Change-Id: I6fdedcde67f76883257d35d1b812ab8a0e3e0733
Related-Bug: #1259292
In preparation for async zone exports, move imports to be their own objects,
away from zone tasks. This is essentially a giant renaming.
Change-Id: If6eefbf5553d0fc09e638e879b88c73c133c56fe
Currently when i export 'DESIGNATE_SQL_DEBUG' from terminal
to false like 'export DESIGNATE_SQL_DEBUG=false', this setting
does not work properly. This patch fixes this behaviour.
Change-Id: Ia6f68b3638e16651f9ba300378f5f68938799cdc
* Creates /v2/zones/tasks/imports, which allows users to view imports as resources
* Creates new database table zone_tasks for asynchronous tasks related to zones, along
with the associated objects/adapters
* Imports are done by passing over the request body, creating an async record in the db,
and spawning a thread to do the import
* Adds a config option to enable zone import
Implements: async-import-export
APIImpact: Adds /zones/tasks/imports and removes import from admin api
Change-Id: Ib23810bf8b25d962b9d2d75e042bb097f3c12f7a