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>
The parameter 'log_min_duration_statement' was updated to support unit
suffixes like 'ms' in [1], but reverted in [2] by accident.
[1] https://review.openstack.org/#/c/370982/
[2] https://review.openstack.org/#/c/537665/
Change-Id: I6fa6785bc8438ccc28a815abd1a99526ff03b87c
Signed-off-by: Zhao Chao <zhaochao1984@gmail.com>
Previously assertTrue is incorrectly used as assertEqual or
assertIsNotNone, this patch fixes. Some assertEqual around the changes
introduced by this patch are also updated to use the proper arguments
convention, from
assertEqual(observed, expected)
to
assertEqual(expected, observed)
Change-Id: If1d75a850594eff72b69e265a25505382e82022b
Signed-off-by: Zhao Chao <zhaochao1984@gmail.com>
A new entrypoint in setup.cfg and a config file are added for
using olso.policy helper script to generate the sample file.
A new tox target also is added to simplify the environment
setting up. Now policy sample file can be generated
automatically, so the in-repo sample file is no longer needed.
Co-Authored-By: Andrew Laski <andrew@lascii.com>
Partial-Implements: blueprint policy-in-code
Change-Id: Ic336fa154ccc05b5e9db3a8e751a484b1cc5aa9c
Signed-off-by: Zhao Chao <zhaochao1984@gmail.com>
Current Nova server volume support is broken. Nova also declared the
'os-volumes_boot' will be deprecated in the future. As creating volumes
by cinderclient has been supoorted for a long time, we could just drop
support of Nova server volume.
This patch also migrate to the new block_device_mapping_v2 parameter of
Nova servers creating API.
Closes-Bug: #1673408
Change-Id: I74d86241a5a0d0b1804b959313432168f68faf89
Signed-off-by: Zhao Chao <zhaochao1984@gmail.com>
The "security.authorization" option is only usable for
mongod and not for mongos service.
When this option is applied to /etc/mongos.conf configuration
file, mongos service doesn't start.
Change-Id: Id798d7269ee80706002bbebe2ff666fc2fecdd1e
Closes-Bug: #1748322
As bandit-baseline check just call tox to run tests, adding it to
in-tree checks instead of gate jobs.
Closes-Bug: #1618549
Change-Id: If6848c69e09117789d566ae47977034d5503fa09
Signed-off-by: Zhao Chao <zhaochao1984@gmail.com>
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>
add_options in trove.db is not used for a long time, and this is the
same situation fofr optparse in python 2.7, so we can safely remove
this part from trove.db.
Closes-Bug: #1553030
Change-Id: I17228eed5c122bce49ce80ec665fe73d6caa1e04
Signed-off-by: Zhao Chao <zhaochao1984@gmail.com>
The versions resource constructs the links by using application_url,
but it's possible that the API endpoint is behind a load balancer
or SSL terminator. This means that the application_url might be
incorrect. This fix provides a config option (similar to other
services) which lets us override the host URL when constructing
links for the versions API.
Co-Authored-By: Nikhil Manchanda <SlickNik@gmail.com>
Change-Id: I23f06c6c2d52ba46c74e0d097c4963d2de731d30
Closes-bug: 1384379
Zuul no longer requires the project-name for in-repo configuration.
Omitting it makes forking or renaming projects easier.
Change-Id: Id890fde91a7e2b3ec9a6cf5ebe540d4fd65938bc
During the Vertica cluster growing/shrinking,
the "update_vertica" command tries to get AWS
metadata even if --ignore-aws-instance-type is
specified.
The only way to avoid the "_get_macs error" is to
define --ignore-install-config option.
This is very similar to this bug[1] but this time
this for the "trove cluster-grow" and "trove
cluster-shrink" commands.
[1] https://bugs.launchpad.net/trove/+bug/1745493
Change-Id: I35f2035039f72b3aa2d9beb665096d4fb57e1c4c
Closes-Bug: #1747050
During the DB2 installation, the db2_install
process asks a question about the license. Disk
Image Builder will hang until "yes" or "no" is
manually entered.
db2_install script provides the "-y" option to
accept automatically the license.
From db2_install help:
Specifies that you have read and agreed to the
license agreement file in the db2/license
directory on the CD. This parameter is mandatory
when -n is specified.
Change-Id: I8a8330adc41cbed60c8472f925b10cf816aed44e
Closes-Bug: #1747031
The DB2 path needs to be changed to something
basic and not using a version number because we
don't want to update the code every time than a
new DB2 version is released.
Updated DB2 version from 10.5 to 11.1, version
10.5 is no more available on IBM website.
Closes-Bug: #1746351
Change-Id: I4fd7c66c3cd5ff8d540e994ada979b59c7def35e
During the Vertica installation, the install script try to get AWS
metadata even if --ignore-aws-instance-type is specified.
The only way to avoid the _get_macs error is to define
--ignore-install-config option.
During the cluster creation, if the process is too long, Vertica
ask a question:
Do you want to continue waiting? (yes/no) [yes]
From the adminTools documentation there is no non-interactive or
timeout options. The only way to have this question answered is
to run "echo yes | " before the "adminTools -t create_db" command.
The only available version from Vertica website is 9.0.1.
Closes-Bug: #1745493
Change-Id: I94472082fac606f4ff14f26c2ca2b620ef0a3bbb
Add some configuration options on valuation rules file,
these options are availables from the release 9.5 and 9.6
New options from 9.5:
- gin_pending_list_limit
- idle_in_transaction_session_timeout
Changelog:
https://www.postgresql.org/docs/10/static/release-9-5.html
New options from 9.6:
- log_min_duration_statement
- backend_flush_after
- bgwriter_flush_after
- checkpoint_flush_after
- force_parallel_mode
- parallel_setup_cost
- parallel_tuple_cost
- replacement_sort_tuples
Changelog:
https://www.postgresql.org/docs/10/static/release-9-6.html
Closes-bug: #1745238
Change-Id: I89d793ccc7fa43deb3c1da7b23ce10cdf1e85c4d
models.DatastoreSchema() needs to be initialized
with a database name.
This change fix the backup on DB2 instance
Change-Id: I95a9c60cd2406d4aa3b6ee52c654b2590a8d7e03
Closes-Bug: #1746626
Looks like SQLAlchemy in version 1.2.x checks if the boolean value
is None, True, False, 1, or 0. We used a "1" in our test, which
does not seem to meet the requirements. In the meantime, if we
change it to 1 here, our function section needs to be changed
as well.
Change-Id: I8df2118fee12fd9dd02caf96a23bc59652efbed7
The element is configured to use version 3 of cassandra, unfortunatly
trove is actually not compatible with version 3.
Closes-Bug: #1745056
Change-Id: Ic22202eeae6f404433a84def8cf5da0e5dc28c7b
The pip command was not installed. Added a couple of
prerequisites (snappy, Cython) and db management package.
The cassandra-tools package provides commands for enabling
and disabling incremental backup, snapshots, and many other
features. It is provided by the cassandra community.
Change-Id: If0f807878d6f3da17e33bc9e40ecb9563de61a25