2735 Commits

Author SHA1 Message Date
Jenkins
f7b3111bad Merge "Enable more unit tests on Python 3" 2016-05-04 17:46:24 +00:00
Jenkins
02e74ccb23 Merge "Port instance unit tests to Python 3" 2016-05-04 17:46:18 +00:00
Jenkins
b8197b1795 Merge "Port more API unit tests to Python 3" 2016-05-04 17:45:58 +00:00
Jenkins
e692e28052 Merge "Port designate code to Python 3" 2016-05-04 17:00:50 +00:00
Jenkins
6a447af625 Merge "Add variables for quota configuration" 2016-05-03 23:45:50 +00:00
Victor Stinner
410eb932e9 Enable more unit tests on Python 3
tox.ini: add more unit tests to Python 3.4, tests already pass thanks
to other changes.

Partially implements: blueprint trove-python3
Change-Id: Iebbf2f413153e0f91f47c3dc5671f6f20415dda9
2016-05-03 12:16:37 +02:00
Victor Stinner
ced1438566 Port instance unit tests to Python 3
* Replace long() with int()
* tox.init: add instance unit tests to Python 3

Partially implements: blueprint trove-python3
Change-Id: Ic8825f05e4f648c959147d1b25d158541c50a3eb
2016-05-02 22:31:06 +02:00
Victor Stinner
a007c948ae Port more API unit tests to Python 3
* HTTP body type must be bytes on Python 3:

  * WsgiLimiterProxy, JSONDictSerializer: encode JSON as bytes
  * Use byte strings for literal HTTP bodies
  * Encode explicitly HTTP body to UTF-8 on Python 3

* Fix the prototype of FakeHttplibSocket.makefile(): only the first
  mode parameter is mandatory
* Replace dict.keys().sort() with sorted(dict.keys())
* tox.ini: add the following unit tests to Python 3.4:

  - api/common/test_extensions.py
  - api/test_versions.py

Partially implements: blueprint trove-python3
Change-Id: I175dc55424e9b5786819f08a584ac967d083db11
2016-05-02 22:31:06 +02:00
Victor Stinner
bdf664bbdf Port designate code to Python 3
* Replace map() with list-comprehension to get a list on Python 3.
* Unicode dance: encode text to UTF-8 for MD5, decode Base32 from
  ASCII to get text.
* tox.ini: test_designate_driver and test_datastore_versions to
  Python 3.4

Partially implements: blueprint trove-python3
Change-Id: I1aa5387908b3f108487ed731cee5f7d9bbfd7d69
2016-05-02 22:31:05 +02:00
Jenkins
79f350852e Merge "[Trivial] Remove unnecessary executable flag for files" 2016-05-02 17:54:02 +00:00
Jenkins
75e1b7386a Merge "Simplify guestagent.pkg: don't use metaclass" 2016-05-02 17:53:45 +00:00
Jenkins
3c16bd66de Merge "Python 3: fix relative imports" 2016-05-02 16:49:24 +00:00
Jenkins
9db22f8fbd Merge "Python3: Add support for unicode, basestring, long" 2016-05-02 16:42:46 +00:00
Jenkins
386434d267 Merge "Port crypto_utils to Python 3" 2016-05-02 16:42:40 +00:00
OpenStack Proposal Bot
7648a68363 Updated from global requirements
Change-Id: Iffe8279d1f62b9b29f7608347e08c1c43a5ea335
2016-04-30 18:10:00 +00:00
ZhiQiang Fan
d53bd22502 [Trivial] Remove unnecessary executable flag for files
There are some files in trove which actually don't have main entry,
they are modules rather than scripts, hence should not have the
executable flag.

Change-Id: I08b549fd339525e29d9c3247fab87901b8bbff69
2016-04-29 19:14:35 +08:00
Peter Stachowski
9e3860d54c Add variables for quota configuration
Many configuration values are hard-coded in the Trove devstack
plugin, however they would be better served letting the
user/developer decide what limits to impose.

The following variables were added to facilitate this:

TROVE_MAX_ACCEPTED_VOLUME_SIZE
TROVE_MAX_INSTANCES_PER_TENANT
TROVE_MAX_VOLUMES_PER_TENANT
TROVE_AGENT_CALL_LOW_TIMEOUT
TROVE_AGENT_CALL_HIGH_TIMEOUT
TROVE_RESIZE_TIME_OUT
TROVE_USAGE_TIMEOUT
TROVE_STATE_CHANGE_WAIT_TIME

These values are only inserted if they are set. If not set,
the Trove defaults are used instead.

Change-Id: I2c568fdfa05064682f372b996a5aebcdd4e93ef3
2016-04-22 20:12:47 +00:00
Jenkins
a3b3fcbd7d Merge "Update the root scenario tests" 2016-04-22 16:17:10 +00:00
Jenkins
c3169966ba Merge "Mysql replicas need to set binlog_format" 2016-04-21 16:53:03 +00:00
Jenkins
a00ad54aea Merge "Updated from global requirements" 2016-04-20 20:43:17 +00:00
Jenkins
49fb7d9647 Merge "pep8: exclude .git/ subdirectory" 2016-04-20 20:43:10 +00:00
Jenkins
599911094b Merge "Python 3: avoid sets.Set and string.letters" 2016-04-20 19:50:52 +00:00
OpenStack Proposal Bot
f266a9849d Updated from global requirements
Change-Id: I1a983e4ff63e502c9667653c4830181d3ed2f3ff
2016-04-20 14:43:12 +00:00
Victor Stinner
1d7b6ef655 Simplify guestagent.pkg: don't use metaclass
Avoid complex metaclass to define pkg.Package. It doesn't seem to
work on Python 3, and simpler code works too :-)

Partially implements: blueprint trove-python3
Change-Id: I880527f043fcddb11926d38b5641b3a61512e27f
2016-04-20 15:52:34 +02:00
Victor Stinner
a462573511 Python 3: avoid sets.Set and string.letters
* Replace the sets.Set type with builtin set type. The sets module
  was removed in Python 3.
* Replace string.letters with string.ascii_letters

Note: On Python 2, string.letters is different than
string.ascii_letters if locale.setlocale() is called. Hopefully,
setlocale() is not used in Trove.

Partially implements: blueprint trove-python3
Change-Id: I47ba8ea15e0cd9481752da1bfdddf374d3146c6b
2016-04-20 15:40:25 +02:00
Victor Stinner
93f448b577 pep8: exclude .git/ subdirectory
When a git branch is called trove-xxx, "tox -e pep8" fails on
checking .git/logs/refs/heads/trove-xxx. It doesn't make sense to
validate Git branches using flake8.

Simply exclude .git from flake8.

Note: [testenv:pep8] of tox.ini looks for "trove-*" to validate
contrib/trove-guestagent.

Change-Id: I7c5582282a63da8cc1b3bbb6b76a267ef894a5d7
2016-04-20 15:36:43 +02:00
Victor Stinner
74e2aaabe5 Python 3: fix relative imports
On Python 3, imports are absolute by default. By default, OpenStack
coding style requires to use relative imports.

Fix imports two use the full "path" to relative imports.

Partially implements: blueprint trove-python3
Change-Id: I2866fdc1a39fb3a20d8384a4082ca468b57d92d3
2016-04-20 15:33:46 +02:00
Victor Stinner
f9ed13a576 Port crypto_utils to Python 3
This change is backward compatible on Python 2:

* Data encrypted with the old code can be decrypted with the new code
* Data encrypted with the new code can be decrypted with the old code

Effect on Python 2: it now is possible to encode Unicode strings
which contain non-ASCII characters. Before encode_data() failed with
UnicodeEncodeError.

Changes:

* pad_for_encryption(): replace chr() with six.int2byte() to get
  bytes on Python 3.
* use byte strings in tests
* encode_data() now encodes data to UTF-8 (if it is Unicode)
* encrypt() and decrypt() now encode the encryption key to UTF-8 (if
  it's Unicode)
* encrypt() now encodes data to UTF-8 (if it's Unicode), it's only
  needed on Python 3 since encode_data() returns Unicode on Python 3.
* test_encode_decode_string(): test also Unicode
* Add new unit tests on encrypt() and decrypt() with known values and
  hardcoded IV.
* tox.ini: add test_common_extensions and test_crypto_utils
  to Python 3.4 (test_common_extensions already passed before).

Note: UTF-8 is the defacto standard encoding in OpenStack. It is
already used widely in all parts of OpenStack.

Partially implements: blueprint trove-python3
Change-Id: I8e991994698d558177580595cf2c7da93ed1e1c8
2016-04-20 14:45:26 +02:00
abhishekkekane
265f0ed9f5 Python3: Add support for raise and ConfigParser
Replaced raise exc_type, exc_value, exc_tb
with six.reraise(exc_type, exc_value, exc_tb)

Used SafeConfigParser, ConfigParser from six.moves

This patch is generated by the following tool using
'raise' and 'six_moves' option for ConfigParser related
changes.

https://github.com/haypo/sixer
Command:
python sixer.py -w 'raise,six_moves' trove/

Partially implements: blueprint trove-python3
Change-Id: Id885b0f4a85a26b93849043b481549be75cfa875
2016-04-20 08:43:37 +00:00
Jenkins
f066d6963f Merge "Imported Translations from Zanata" 2016-04-20 01:51:10 +00:00
Jenkins
7261de0d24 Merge "Port more common unit tests to Python 3" 2016-04-19 23:17:43 +00:00
Jenkins
aa9cc79b78 Merge "Port test_template unit test to Python 3" 2016-04-19 22:59:46 +00:00
Doug Shelley
9b03fec1e1 Mysql replicas need to set binlog_format
For GTID replication we set the replica source (i.e. master)
to have a binlog_format of MIXED. We aren't setting this on
the replicas so they default to STATEMENT. This causes a problem
with certain "non-deterministic" functions (e.g. RAND()). This
changes replica config templates for Mysql and Percona to use
MIXED mode.

A new scenario test was introduced to validate that the
replicas have this set.

MariaDB doesn't appear to have this issue so it wasn't changed.

Scenario tests for Mysql, Percona and MariaDB were run to
validate this change.

Change-Id: I936cd9bc53a812af19653e9b5b472103fab2b6c1
Closes-bug: 1563541
2016-04-19 13:07:09 +00:00
abhishekkekane
a56301c237 Python3: Add support for unicode, basestring, long
Replaced basestring with six.string_types
Replaced (int, long) with six.integer_types
Replaced unicode with six.text_type

This patch is generated by the following tool using
'basestring', 'long' and 'unicode' options.

Manually replaced unicode(ex) with oslo_utils.encodeutils(ex)

https://github.com/haypo/sixer
Command:
python sixer.py -w 'basestring,long,unicode' trove/

Partially implements: blueprint trove-python3

Change-Id: I6fa42674060067663ef819247ea793ef3d8aa0da
2016-04-19 07:02:39 +00:00
OpenStack Proposal Bot
c09d8f3e8c Imported Translations from Zanata
For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure

Change-Id: I6fb050b46ea7f34a1a17d17ba5c34b98f41d8a58
2016-04-19 06:12:05 +00:00
Jenkins
9f877e5ba7 Merge "Python3: Add support for iter.next" 2016-04-19 00:26:51 +00:00
Jenkins
40110dbf32 Merge "Python3: Add support for iteritems and iterkeys" 2016-04-18 22:39:38 +00:00
Jenkins
2844e32811 Merge "Fixed kwargs being defaulted to CONF values" 2016-04-18 20:43:23 +00:00
Petr Malik
6ace3dda60 Update the root scenario tests
Incorporate the changes made as a part of the cluster-root
tests introduced in review 266005:

    - add test scenario for: bug 1549600
    - simplify turning off unsupported root-disable tests
      by introducing a single assertion hook that runs before all
      related tests
    - ping the datastore as root to verify it can connect
    - ping after root-disable to verify it cannot connect
    - add missing ping implementations to Cassandra and Redis helpers
    - enable root with password tests on MySQL and related
    - use the same helper method to get root credentials as
      the cluster-root tests
    - also assert the expected root-user-name if specified
    - cleanup auxiliary backup
    - add Postgres root credentials
    - Skip root-cluster test on Redis
    - minor cleanup
    - increased the low guestagent call timeout (helps tests
      run more stable).

Depends-On: I8a4321ac062b1ec565945b49dbb7c619b6da867f

Change-Id: I3fb0a8bb37fd124c22573552ff61852ead23e9a0
Related-Bug: 1529965
Related-Bug: 1549969
Related-Bug: 1549600
2016-04-18 13:16:17 -04:00
Jenkins
d969b08e52 Merge "Tests verify applied configuration values" 2016-04-18 15:01:44 +00:00
Jenkins
1d2ff0304a Merge "Do not remove root user on disable" 2016-04-18 12:09:16 +00:00
Jenkins
3db9d0e4f4 Merge "blacklist_regex is not an option" 2016-04-18 12:08:56 +00:00
Jenkins
b68f3e700f Merge "Python3: Add support for httplib, urlparse" 2016-04-18 10:02:18 +00:00
Jenkins
4f08f231a1 Merge "Cleanup Mysql replication test on completion" 2016-04-18 07:12:32 +00:00
OpenStack Proposal Bot
143991ea5d Imported Translations from Zanata
For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure

Change-Id: I64f1781889347ea69844a56774b54e99cf258f8b
2016-04-17 06:11:01 +00:00
Brandon Irizarry
64a869dbaf Fixed kwargs being defaulted to CONF values
The Trove code is full of numerous cases where kwargs are
defaulted to CONF values. This is an error-prone
way of setting up a default value, as python sets these one
time only. This fix accounts for that.

Change-Id: Icc0858ccb2d3e2584bf6f3d1542a7d631b251ac8
Closes-Bug: 1571076
2016-04-16 23:53:15 +00:00
Jenkins
3161fe6202 Merge "PG test-helper create matching db for test user" 2016-04-16 13:53:34 +00:00
Jenkins
e06de8c3ae Merge "Add user access scenario tests" 2016-04-16 13:42:15 +00:00
Jenkins
ec8267cd68 Merge "Revert the legacy_compute v2 api for nova" 2016-04-16 03:40:18 +00:00
Petr Malik
52bc1ab9c8 Do not remove root user on disable
The existence of the root user (with remote access)
is used to determine whether root was ever enabled on a restored
instance.
Do not remove it, just generate a new random password for it.

Change-Id: I8a4321ac062b1ec565945b49dbb7c619b6da867f
Closes-Bug: 1549600
2016-04-15 07:54:12 -04:00