3890 Commits

Author SHA1 Message Date
Zhao Chao
579f5afc64 Use RootHistory to check if root is ever enabled
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>
2018-02-28 09:14:36 +08:00
Zuul
b59b6ae968 Merge "Add default configuration files to data_files" 2018-02-27 23:39:00 +00:00
Zuul
85cccf7891 Merge "Fix incorrect usage of assertTrue" 2018-02-27 18:31:11 +00:00
Zuul
b0ae74f561 Merge "Fix PostgreSQL non-dynamic configration tests" 2018-02-27 08:57:54 +00:00
Zhao Chao
9d159fd0e7 Fix PostgreSQL non-dynamic configration tests
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>
2018-02-26 17:02:55 +08:00
Zhao Chao
3519434b5b Fix incorrect usage of assertTrue
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>
2018-02-26 15:17:58 +08:00
wangqi
de26c5ec79 drop extra word to fix typo
Change-Id: I6c55ce58bae79da6d2d18a5fd017d4932a637e17
2018-02-24 04:27:57 +00:00
npraveen35
d6bd37f3f3 Remove install-guide tox env
The install-guide tox env is not used any more after docs migration.

Change-Id: I93c53d02afbbb36d4a3e5641e6d11aab9dcd7d8a
2018-02-22 17:45:22 +00:00
Zuul
0d555bf85a Merge "Allow host URL for versions to be configurable" 2018-02-22 05:10:55 +00:00
Zuul
739600802e Merge "Generate policy sample file automatically." 2018-02-21 04:30:18 +00:00
Zuul
a7dd2e1047 Merge "report_root should always use context.user" 2018-02-21 04:21:29 +00:00
Zhao Chao
71ebd353ca Generate policy sample file automatically.
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>
2018-02-12 18:11:22 +08:00
Zuul
f0c03c114e Merge "Add bandit-baseline check job." 2018-02-12 04:40:36 +00:00
Zuul
bdafaf9515 Merge "[api-ref]: update instance creating parameters." 2018-02-12 03:51:31 +00:00
Zuul
f18779278c Merge "Remove support of creating volume from Nova." 2018-02-11 20:30:56 +00:00
Zhao Chao
51b73cf198 [api-ref]: update instance creating parameters.
Closes-Bug: #1643496
Change-Id: I8c9ca4ad690751d3c53cbe9469cf5864a528d631
Signed-off-by: Zhao Chao <zhaochao1984@gmail.com>
2018-02-11 15:18:42 +08:00
Zuul
fcebec9b68 Merge "Remove security.authorization option from mongos" 2018-02-09 17:22:18 +00:00
Zhao Chao
29362a18a4 Remove support of creating volume from Nova.
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>
2018-02-09 14:30:50 +08:00
Gaetan Trellu
e15fe71733 Remove security.authorization option from mongos
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
2018-02-08 18:54:06 -05:00
9847ec0f63 Update reno for stable/queens
Change-Id: I795681aa5045541f8ab852a399ddc1cfa1e7d39e
2018-02-08 20:09:42 +00:00
Zhao Chao
690aa0c23f Add bandit-baseline check job.
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>
2018-02-07 18:10:30 +08:00
Zhao Chao
3b726f3013 report_root should always use context.user
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>
2018-02-07 17:05:54 +08:00
Zhao Chao
9e5186b95b Remove unused optparse code in trove.db
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>
2018-02-07 17:04:10 +08:00
Zuul
cdc7b37cae Merge "Zuul: Remove project name" 2018-02-07 05:13:10 +00:00
Zhao Chao
1667ad5e80 Allow host URL for versions to be configurable
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
2018-02-07 11:31:45 +08:00
James E. Blair
e8cdc26f42 Zuul: Remove project name
Zuul no longer requires the project-name for in-repo configuration.
Omitting it makes forking or renaming projects easier.

Change-Id: Id890fde91a7e2b3ec9a6cf5ebe540d4fd65938bc
2018-02-05 23:43:27 -08:00
Zuul
e8df4126f5 Merge "Update the validation template for postgresql" 2018-02-04 04:56:03 +00:00
Zuul
1c51017ade Merge "Unable to grow/shrink Vertica 9.x cluster" 2018-02-03 19:24:19 +00:00
Zuul
d8ae6464a8 Merge "Unable to perform backup on DB2 instance" 2018-02-02 23:18:22 +00:00
Zuul
692100db17 Merge "Accept the IBM DB2 license during the DIB process" 2018-02-02 23:04:18 +00:00
Gaetan Trellu
4d747a997f Unable to grow/shrink Vertica 9.x cluster
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
2018-02-02 16:12:20 -05:00
Zuul
4b95da49cb Merge "Improve Vertica 9.x support" 2018-02-02 18:13:38 +00:00
Gaetan Trellu
c334c5e46d Accept the IBM DB2 license during the DIB process
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
2018-02-02 11:12:02 -05:00
Zuul
9a6f476785 Merge "[api-ref] Add sections for instance logs." 2018-02-02 11:48:32 +00:00
Zuul
278c100240 Merge "Remove hardcoded version in DB2 install path" 2018-02-02 04:51:20 +00:00
Gaetan Trellu
770e311075 Remove hardcoded version in DB2 install path
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
2018-02-01 12:41:48 -05:00
Gaetan Trellu
3bc8a63c33 Improve Vertica 9.x support
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
2018-02-01 12:32:38 -05:00
Zuul
3e88cea5f4 Merge "Revert Cassandra version to 2 on ubuntu element" 2018-02-01 06:51:13 +00:00
Pierre Blanc
902bf78128 Update the validation template for postgresql
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
2018-02-01 02:20:17 +00:00
Gaetan Trellu
932c6756e3 Unable to perform backup on DB2 instance
models.DatastoreSchema() needs to be initialized
with a database name.

This change fix the backup on DB2 instance

Change-Id: I95a9c60cd2406d4aa3b6ee52c654b2590a8d7e03
Closes-Bug: #1746626
2018-01-31 19:23:10 -05:00
jiansong
21dcb414e5 Fix gate error
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
2018-01-31 01:51:18 -08:00
Zhao Chao
e4f181e424 [api-ref] Add sections for instance logs.
Change-Id: I3b0eb2103c89610ec494ac33407e8a7969af1164
Signed-off-by: Zhao Chao <zhaochao1984@gmail.com>
2018-01-29 11:01:34 +08:00
Zuul
393c5f8c00 Merge "Updated from global requirements" 2018-01-27 22:12:39 +00:00
Zuul
67c9ed395e Merge "Add innodb rules for mysql validation template" 2018-01-27 19:19:23 +00:00
Pierre Blanc
c4ac70a428 Add innodb rules for mysql validation template
Add some nodb configuration options on valuation rules file,
these options are availables from the release 5.6 and 5.7

https://dev.mysql.com/doc/refman/5.6/en/innodb-parameters.html
https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html

Closes-bug: #1745477
Change-Id: I2636f4fae06e50be9cfee1a344b3d1f094b2173d
2018-01-26 16:05:39 -05:00
Pierre Blanc
c1b82ffa9c Revert Cassandra version to 2 on ubuntu element
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
2018-01-26 11:47:15 -05:00
Zuul
0781e2972d Merge "[api-ref] Update style and instances api." 2018-01-26 11:31:06 +00:00
Zuul
d5186ca06f Merge "Fix Cassandra element" 2018-01-26 06:10:47 +00:00
Luke Browning
2ae9da7623 Fix Cassandra element
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
2018-01-25 18:18:07 -06:00
Luke Browning
264f8be347 Change file permissions on element script
Needs to be executable to run

Change-Id: I1302d8ea805f3dc023ef7224ed4aa9b4d06ff371
2018-01-25 16:13:18 -06:00