summaryrefslogtreecommitdiff
path: root/trove/extensions
Commit message (Collapse)AuthorAgeFilesLines
* Fix deprecation warningsTakashi Natsume2022-10-151-1/+1
| | | | | | | | | | | | | | Fix the following deprecation warnings. * DeprecationWarning: Using the 'user' argument is deprecated in version '2.18' and will be removed in version '3.0', please use the 'user_id' argument instead * DeprecationWarning: Property 'user' has moved to 'user_id' in version '2.6' and will be removed in version '3.0' Change-Id: I18802ae1e2318eae3c62a26459178b259c728ac4 Signed-off-by: Takashi Natsume <takanattie@gmail.com>
* Allow regular user to get quotas16.0.0.0rc116.0.0Lingxian Kong2021-08-251-2/+11
| | | | | | | | | The project user can query the project's own resource quota. Story: 2009140 Task: 43082 Change-Id: Iebac740e982a89fcf882a2cfc3e447ac53ee6656
* Show all the instances in descending order of creation timeLingxian Kong2021-07-101-2/+3
| | | | | | | This is for list instance response of admin user, keep consistent with the behavior of normal user. Change-Id: I0000b9b0139471064c9589fe5c350b6facdd80dd
* Support datastore version number for creating configurationLingxian Kong2020-11-191-0/+7
| | | | | | | | | | | | * Support "version_number" for creating configuration. * Fixed a bug for deleting datastore version, the config parameters should be deleted first. * Support "--version" for trove-manage datastore_config_parameters sub-commands. Change-Id: Ieb0def81f2347c06a05eb354ad36b4fa807f7621 Story: 2008358 Task: 41264
* Update datastore version nameLingxian Kong2020-11-181-3/+6
| | | | | | | Story: 2008358 Task: 41264 Change-Id: I5b0bb30c1cf7274bf8cff14b377dea5508e3974d
* Add 'version' to datastore versionLingxian Kong2020-11-172-3/+10
| | | | | | | | | | | | | This patch is part of story 2008358 implementation. 1. DB schema change 2. trove-manage datastore_version_update subcommand change 3. API change for creating and listing datastore version. Story: 2008358 Task: 41264 Change-Id: I8069e6f4b972497f2b8be540ea35047d5fb2f9a5
* Use datastore manager as opposed to name to restrict actionsSam Morrison2020-11-051-2/+3
| | | | | | Change-Id: I0e00de3bc5c0ff797fc5c1a13f0275d596c12b5d Story: 2008314 Task: 41209
* Support to get instances of a specified projectLingxian Kong2020-10-212-10/+15
| | | | | | | This patch also fixes a performance issue when the adm user is getting all the instances. Change-Id: Icd6345d6c97648cdfbfaa8d9edac7315a1409356
* Remove six usage and basestring checkwangzihao2020-10-161-3/+1
| | | | | | | | | | | | | | | | | | Remove basestring check. Remove six Replace the following items with Python 3 style code. - six.string_types - six.int2byte - six.indexbytes - six.add_metaclass - six.StringIO - six.text_type - six.integer_types - six.binary_type - six.BytesIO - six.reraise Change-Id: I4fb9033d152963c504ceb4d5c4d08f934ee4accb
* Image tags support in datastore versionLingxian Kong2020-10-092-20/+35
| | | | Change-Id: I0e51d08515c121e3a7b0e82b6e4c4161bb4fbc4a
* Merge "Remove six.moves.urllib"Zuul2020-09-251-1/+1
|\
| * Remove six.moves.urlliblikui2020-09-251-1/+1
| | | | | | | | | | | | Replace the six.moves.urllib with Python 3 style code Change-Id: Ieb4d0359442cdb1dab17ffa2de74b834199ec74c
* | Set limit to -1 when getting Nova instancesLingxian Kong2020-09-231-1/+2
| | | | | | | | | | | | | | Story: #2008179 Task: 40936 Change-Id: Id433117ed842177593ae4589cc7d491c760b9e77
* | Only enable user and database API for MySQLLingxian Kong2020-09-132-8/+29
|/ | | | Change-Id: Ic59f2fd94c5f216414effe7d13d0dd486dce9243
* Support to rebuild instance by adminLingxian Kong2020-08-061-1/+10
| | | | Change-Id: I48f8c6f997daeb6d82ff62b3325277d86fee2147
* Added checks for deleting datastore version13.0.0.0rc113.0.0Lingxian Kong2020-04-234-6/+21
| | | | | | | | | | * Hard delete the datastore_configuration_parameters table record. * Make 'datastore_version_id' nullable for 'instances' table. * Check if the datastore version is still being used before removal. Story: 2007563 Task: 39451 Change-Id: I84e4a31f14f9327cc01ff2d699167d91112e1565
* Improve API docLingxian Kong2019-12-241-4/+1
| | | | Change-Id: If48ef016c6fb7a875ceabc9f106e4cd85858d147
* Support HEALTHY status for db instanceLingxian Kong2019-12-141-1/+3
| | | | | | | | | | | - 'HEALTHY' means the db service is responsive, 'ACTIVE' means the db service is alive. - Remove the CI job fakemodetests, but will add similar testing task in the future. - Fix the periodic CI job - Remove MongoDB and related jobs Change-Id: I5abe9091ba203297dc87db5fba139179166321f7
* Use dedicated service credential configLingxian Kong2019-10-107-14/+18
| | | | | | The current admin credential config options are confusing Change-Id: I92c15c065edf364b955f2243b3599e0b8cae8b4f
* Support to create public trove instanceLingxian Kong2019-09-1117-693/+4
| | | | | | | | | | | | | | | | | | | | - The users need to specify the network to create Trove instance, but trove-taskmanager will create port in that network for Nova instance creation. Using port gives Trove more capabilities to define how the database service is exposed. - Deprecate ICMP protocol for the instance. - Restrict 'nics' parameter for creating instance. - Add 'access' parameter for creating instance. - Add 'public_network_id' option in order to create floating IP for the instance. - Do not create records for security groups, but Trove can still delete existing instances for backward compatibility. - Delete unreasonable Host, Account, Storage API. Story: 2006500 Task: 36468 Task: 36466 Change-Id: I80827e1ad5e6b130cbf94c2bb7a909c44d5cf1e5
* Improve devmode=flase when building the imageLingxian Kong2019-08-251-1/+8
| | | | | | | | | | | | | | | | | During debugging, the following changes are also included: - Support to specify an image ID to run the integration test. - Fix the reboot function bug. - Remove the unsuccessful restart test. How to run integration test with dev_mode=false: ADMIN_PASSWORD=password \ SERVICE_PASSWORD=password \ DEV_MODE=false \ /opt/stack/trove/integration/scripts/trovestack gate-tests mysql mysql Change-Id: I31d4ee579a554f4c98f9facb9fd4b7779665a3dd
* Remove SecurityGroup API extensionLingxian Kong2019-04-063-343/+0
| | | | | | | | | SecurityGroup API extension is not mentioned in Trove API doc. Security group information could be retrieved from Neutron. Change-Id: Ifb134eaada09ca4dc739eddb5772681b486cad93 Story: #2005366 Task: #30341
* Do not use self in classmethodzhufl2019-01-101-1/+1
| | | | | | cls should be used in classmethd, instead of self. Change-Id: I0797a0ad0007450d76efa02bd05a5ca9db878938
* fix tox python3 overridesMarcin Piwowarczyk2018-09-181-2/+2
| | | | | | | | | | | | | | | | | | We want to default to running all tox environments under python 3, so set the basepython value in each environment. We do not want to specify a minor version number, because we do not want to have to update the file every time we upgrade python. We do not want to set the override once in testenv, because that breaks the more specific versions used in default environments like py35 and py36. Change-Id: I9ee34642c700d1e6ba9c2f3891b7fa1f7f7e1e1d Depends-On: I8989fd4798e80eae27408017e1543819a68b4ab1 Signed-off-by: Doug Hellmann <doug@doughellmann.com> Signed-off-by: Marcin Piwowarczyk <m.piwowarczy@samsung.com> Co-Authored-By: Doug Hellmann <doug@doughellmann.com>
* Sync the data fields of DB* class and table fields.zhanggang2018-07-171-9/+12
| | | | | | | | | | | | This update try to fix some problems: 1. define the 'id' both in _data_fields and _auto_generated_attrs. 2. some of tables don't have the 'id' field. 3. _data_fields of DBInstance miss some table fields. 4. Change the key of persisted_models as the same of table name to make it more readable. Change-Id: I0ad96824e8de978ff5b6766085549b1e1a2509cf Signed-off-by: zhanggang <zhanggang@cmss.chinamobile.com>
* Return 204 instead of 200 for root-disable APIZhao Chao2018-03-021-1/+1
| | | | | | | | | | | | | | | | As no content will be returned to the client if a root-disable request succeeds, a HTTP 204 (Not Content) response is more appropriate. Redis root-disable scenario test fails because it's return HTTP 204, but all API related tests are expecting a HTTP 200. Although changing Redis root-disable API is a much simpler way to resolve the problem, migrating from HTTP 200 to HTTP 204 should be a better solution. Related tests and documents are also updated accordingly. APIImpact Change-Id: If732a578009fd35436e810fb7ceceefd1ada3778 Signed-off-by: Zhao Chao <zhaochao1984@gmail.com>
* Use RootHistory to check if root is ever enabledZhao Chao2018-02-287-74/+9
| | | | | | | | | | | | | | | | | | | | | | | When disabling root, there is no need to call guestagent to check whether the root user is ever enabled. Root hisotry table should be used for this purpose. As datastore specific root controller of MySQL/Cassandra/PostgreSQL were created only for the '_find_root_user' which were calling guestagent to find root user, these controllers are removed and 'DefaultRootController' is used instead. RedisRootController is also updated as it didn't do this check previously. Unittests directory structure is also slightly changed. It's more clear to use similar directory hierarchies for testing and source code, e.g. trove/extensions/common/service.py trove/tests/unitests/extensions/common/test_service.py Change-Id: I9faac61d9650347b51f23e8fcaf5a92aed5fbf93 Signed-off-by: Zhao Chao <zhaochao1984@gmail.com>
* report_root should always use context.userZhao Chao2018-02-073-18/+12
| | | | | | | | | | | | | | | | | The RootHistory intends to record by whom and when the root user of the underlying datastore backend was enabled. So the "user" column should always be set to the context user, not the actual root user in the database. But report_root(and report_root_enabled in taskmanager.models) use the database user instead, this is not correct, This patch will fix. Also remove the "user" argument from Root.create() and HistoryRoot.create() because the context is already passed in as an argument when these methods are called. Closes-Bug: #1546372 Change-Id: I3b4c8ee56c7e0876fb384f0c5841d2d391bd555d Signed-off-by: Zhao Chao <zhaochao1984@gmail.com>
* Remove log translationsZhao Chao2018-01-2417-150/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to discussions on the ML, log messages should not be translated any more. This patch also: * removes all usage of _LI, _LW, _LE, _LC; * updates log translation hacking rule. ML discussions: http://lists.openstack.org/pipermail/openstack-i18n/2016-November/002574.html http://lists.openstack.org/pipermail/openstack-dev/2017-March/113365.html The original commit messages are kept as following to make a historic note: remove unwanted log translations recent discussions on the ML have led to the decision to eliminate all translations for messages that are destined for log files but retain them for messages that are going to be returned as exceptions and potentially shown to end users via an API. see [1], [2]. This change does that as follows. 1. If a string is being used to generate an exception, it will still be translated. Still Trove used both _LE and _ for these translations, there are some cases where _LE has been simply changed to _, and not removed. 2. If a string is used for a logging message, remove the use of _, _LE, _LW, _LI. Also, I have long felt that we have had a creep of checks in the pep8 tests that apparently make the code easier to read. I strongly believe that these kinds of "easier to read" things make sense if they are followed across all projects and not just gratuitously added one project at a time. I've taken this opportunity to reduce the merge mess caused by this change, to sync up our ignore flags with a long list of ignores from Nova. When they made the change for removing log translation, they could do it in an automated-way like I have because they didn't have to deal with under and overindented lines for visual edit (E127). Same for Cinder. Changes 448443 [3] and 447839 [4] were inadequate because they only addressed a little part of the problem, namely removing the use of _LE, _LI, and _LW, and I think this is a change we don't need to dribble in a few files at a time. The changes are straightforward and should be taken in a single lump to make it easy to deal with the merges coming. [1] http://lists.openstack.org/pipermail/openstack-operators/2017-March/012887.html [2] http://lists.openstack.org/pipermail/openstack-dev/2017-March/113365.html [3] https://review.openstack.org/448443 [4] https://review.openstack.org/447839 Co-Authored-By: Amrith Kumar <amrith@amrith.org> Co-Authored-By: Valencia Serrao <vserrao@us.ibm.com> Change-Id: I5f86c982469e625997fc8bd15c6fae0fc77a8c64
* Merge "Fix wrong error message for secgroup_rule method"Zuul2018-01-181-4/+4
|\
| * Fix wrong error message for secgroup_rule methodzhanggang2017-12-221-4/+4
| | | | | | | | | | | | | | | | | | | | In method `create_sec_group_rule`, when add_rule raise error. The error message would confuse the user, it failed to create secgroup_rule, not secgroup. In method `delete` of class `SecurityGroupRule` is the same problem, fail delete a secgroup rule, not a secgroup. Change-Id: Id5ad4a7b8a4d292ba0a0bef5231db8d6af8eb29a
* | Initialize BadRequest exception with correct message.Zhao Chao2018-01-122-2/+2
|/ | | | | | | | | | Currently some BadRequest exceptions are raised with a wrong argument 'msg', this leads to totally helpless informations returned by the API when errors occurr. This patch fixes the problem. Change-Id: Ifd821e8297a44fd0b25f879f79fe6a2456c1d8a5 Signed-off-by: Zhao Chao <zhaochao1984@gmail.com>
* Implementation of root-enable, root-disable in redis.Fan Zhang2017-12-084-0/+243
| | | | | | | | | Implement root-enable, root-disable for redis to manage redis authentication. Change-Id: If88092c24c51192a19eeec8312701e2c6d709db9 Implements: blueprint root-enable-in-redis Signed-off-by: Fan Zhang <zh.f@outlook.com>
* Merge "Avoid load deleted instances that belong to a cluster."Zuul2017-11-142-2/+4
|\
| * Avoid load deleted instances that belong to a cluster.zhanggang2017-11-032-2/+4
| | | | | | | | | | | | | | | | Cluster node may be set deleted by "shrink" operation. In this case, when use DBInstance.find_all(cluster_id=<id>).all(), it will return all instances include deleted which may raise errors. Change-Id: I088f3a99e0185ae33df4ce84c080adb7d813f17c
* | Merge "Support -1 as unlimited quota restraint in Trove."Zuul2017-11-091-0/+3
|\ \ | |/ |/|
| * Support -1 as unlimited quota restraint in Trove.Fan Zhang2017-11-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | In other projects like nova and neutron, hard limit -1 often means unlimited quota restraint. But Trove dose not support that. This patch aims at two things: 1. Support -1, as unlimited quota restraint in check_quotas() 2. Add quota check to accept only -1, not -2 or other negative numbers when updating quotas. Change-Id: I028e6d7814ff240aa3f697e3d6ac8c7bac5bf3fd Closes-bug: #1729791 Signed-off-by: Fan Zhang <zh.f@outlook.com>
* | TrivialFix: Redundant alias in import statementDao Cong Tien2017-10-181-1/+1
|/ | | | Change-Id: I4a9a755b322a8f9097dc532dcc38027a7e3ca155
* Merge "Improve list-of-ports validation"Jenkins2017-06-161-3/+2
|\
| * Improve list-of-ports validationTrevor McCasland2017-06-011-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | List options tcp_ports and udp_ports are lists of strings and some with a '-' in the middle to indicate a range. To help validate the options better a new type was introduced to oslo.config called Range. oslo.config version 3.18.0 merged this Range type which will no longer require the following in our project: * utility function gen_ports because a Range of ints are returned * test to check for proper from-to format, the type is smart so it flips the numbers around for us. So 63000-300 returns Range(300, 63001) 63001 because inclusion=True is set by default. Change-Id: I63b6a865a3f3c79202dd299f6cd25dd59e182252 Closes-Bug: #1500141
* | Handle isotime deprecation in oslo_utils.timeutilsAmrith Kumar2017-06-092-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | oslo_utils.timeutils is deprecating isotime(). In reality they are deprecating some other things as well but Trove doesn't (currently) use any of those things. Much has been written on the subject of this deprecation. I think the proposal to merely replace isotime with datetime.datetime.isoformat() is a little simplistic. Well intentioned, but nonetheless I believe that it is simplistic. The primary issue I could find with oslo_utils.timeutils.isotime() was the fact that it was naive. I think it could well have been fixed in oslo_utils but for whatever reason(s) oslo decided not to want to go that route. The primary challenge from Trove's perspective is that I want to respect the existing API contract while at the same time get an implementation of time handling that is not identical in its flaws with oslo_utils.timeutils.isotime(). This change set attempts to address that by making trove.common.timeutils.isotime() that is aware. It also implements a utcnow_aware() function that is aware. ISO 8601 allows for four representations of timezone and those are <time>Z <time>[+-]hh:mm <time>[+-]hhmm <time>[+-]hh Trove conventionally used the first one, even if the time wasn't really a UTC time. That's one of the things being fixed here. In review cp16net asked whether this change removes the 'Z' at the end of time strings generated by the isotime() function. The answer is NO. The new isotime() function performs identical to the old and now deprecated function in oslo_utils.timeutils for UTC (Z) times. There was a utcnow() function in trove.common.utils which just wrapped datetime.datetime.utcnow(). That has been moved now to trove.common.timeutils with the other new time related functions. There were a couple of places in Trove where code was using datetime.now() which was not ideal. Those have been corrected now as well. Unit tests have been proposed for the new routines. Closes-Bug: #1532120 Change-Id: Ic5abf6669edd4f1a9fd62e61f437565aa887aebe
* | Merge "Handle log message interpolation by the logger part 7"Jenkins2017-06-0718-95/+95
|\ \ | |/ |/|
| * Handle log message interpolation by the logger part 7Gábor Antal2017-02-2818-95/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | The following directories were fixed in this commit: - extensions/ According to OpenStack Guideline[1], logged string message should be interpolated by the logger. [1]: http://docs.openstack.org/developer/oslo.i18n/guidelines.html#adding-variables-to-log-messages Change-Id: I47b7215cd0b61c52405917ecde849a3ea1ae5e32 Related-Bug: #1642552
* | fix issue with Nova passthrough deprecationAmrith Kumar2017-05-261-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Nova Networking was deprecated in Newton and some of the API calls that were part of NN were still in use by Trove. With the arrival of python-novaclient 8.0.0, this caused a failure. Nova also deprecated the image pass through capability. The management API uses some of that to test whether an image id is valid or not. This change fixes the management API, and the attendant scenario tests. Depends-On: I142f97d691fa55e9824714c9c224f998ad72337e Change-Id: I2f2a12207581a94fb8561a6d65a3a79b4a29b063 Closes-Bug: #1690936
* | Removed reimport in models.pyGábor Antal2017-02-141-16/+14
|/ | | | | | | | | In trove/extensions/mgmt/instances/models.py, trove.instance.models was imported twice, as different names. TrivialFix Change-Id: I30da8fc3587c8c705da05e7af699a277f544eac2
* Merge "Add i18n translation to extensions 3/3"Jenkins2017-01-301-1/+1
|\
| * Add i18n translation to extensions 3/3Trevor McCasland2017-01-291-1/+1
| | | | | | | | | | | | | | | | | | This is patch 3 of 3 that aims to add i18n translation to the extenstions directory and some other files. Custom hacking rules will come later to enforce this style. Change-Id: I94a341ba1fb4178e0c358c37ea31623d48938ec6 Depends-On: I6fb2bdcc4b83457e08b24599fb4a297ef6ec6c14
* | Add i18n translation to extensions 2/3Trevor McCasland2017-01-101-2/+4
|/ | | | | | | | | This is patch 2 of 3 to add i18n translation to the extensions directory and some other files. Custom hacking rules will be added later to enforce this style. Change-Id: Ifdf426684473fb05cae63877c334e6cf65aa5234
* Add support for Oslo Policies to TrovePetr Malik2016-12-062-5/+61
| | | | | | | | | | | | | | | | | | The Oslo Policy library provides support for RBAC policy enforcement across all OpenStack services. Update the devstack plugin to copy the default policy file over to /etc/trove in the gate environments. Note: Not adding a rule for 'reset-password' instance action as that API was discontinued years ago and is now just waiting for removal (Bug: 1645866). DocImpact Co-Authored-By: Ali Adil <aadil@tesora.com> Change-Id: Ic443a4c663301840406cad537159eab7b0b5ed1c Implements: blueprint trove-policy
* Merge "Fail on deleting non-existing database"Jenkins2016-11-212-0/+12
|\