User quota update should not exceed project quota

When user quota is not set, the default quota set in
config file will be used as the default user quota,
this will break the logic of user quota (the default
user quota should be restricted by the project quota)

Fixes bug 1208400
Fixes bug 1205582

Change-Id: Id98d504d8f5e0dda642fa5e7c550acea79520c3d
Clean up db.sqla.Models.extra_keys interface

Previously we were checking that Class has
_extra_keys() method and if it has then extend columns with this list.

It will be much cleaner to have in ModelBase this method so we will be able
to avoid this check,  and as method should contains verb we change the name
also to _get_extra_keys().

It changes API so we should also make related in other projects.
But there is not so much work (e.g. in Nova there are only 2 occurences)

Change-Id: Ib9f3a165fae340a1c887769ce8f21a70c28458d0
Closes-Bug: #1119717
Provide useful defaults for config generator

Right now if you run generate_sample.sh in (for example) Nova,
you have to provide all three parameters for it to work right.
This change tweaks the defaults so that the script can be run
from the root of the project directory with no parameters.
This should apply to all of the projects, not just Nova.

Closes-Bug: 1204204

Change-Id: Iaa0a899dd4f34f44317f9574688e305365a604bf
Replace using tests.utils part2

It is the second step to replace using tests.utils with
stack.common.test.
In this patch second part of tests is changed for using
openstack.common.test and added needed fixtures in test classes.

Change-Id: I81e3ff41827f7153b650255e219ce25cb282507b
bp: common-unit-tests
Replace using tests.utils part1

It is the second step to replace using tests.utils with
stack.common.test.
In this patch first part of tests is changed for using
openstack.common.test and added needed fixtures in test classes.

Change-Id: Id95743059818a80af5bf1fab4ae1cee528b92809
bp: common-unit-tests
rootwrap: improve Python 3 compatibility

Change-Id: I83a7aa7e7ebecb287b0f25e5bf510c10779c4ddf
python3: Fix UserString import

In python3 UserString got moved to collections. This results in the
following traceback while running with python3:

ImportError: No module named 'UserString'

Change-Id: Ica44cd027e012e13828c0a84b3b36607cc92fe69
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Merge "Replace using tests.utils part1"
fileutils: don't import __builtin__

This doesn't exists in Python 3, so let's just use six for this.

Change-Id: I9634179372351c912d5d8c200676e405aabbed59
Merge "Replace using tests.utils part2"
Merge "python3: Fix UserString import"
Merge "fileutils: don't import __builtin__"
Merge "User quota update should not exceed project quota"
excutils: use six.reraise to re-raise

This makes the re-raising working in Python 3 too.

Change-Id: I87fd89ff575ad93889588765f889a9040aaf64ff
jsonutils: do not require xmlrpclib

xmlrpclib isn't shipped anymore in Python 3, so let's support it
optionally.

Change-Id: Ic94f238a5f92f28ae1b6154fb56f00c4c9fa3283
jsonutils: make types py3 compatible

In Python 3, there's no long nor NoneType. Let's replace by equivalent
values.

Change-Id: Id1aa7af26b0f5d929337cc373c6a4f802bba2cec
Merge "Provide useful defaults for config generator"
Merge "Clean up db.sqla.Models.extra_keys interface"
Refactors if statement in config generator

Appends two if statements since the two conditions are orthogonal

Change-Id: Icff02179fb83017dea02f2a9cd29ec1c1973f805
Merge "jsonutils: do not require xmlrpclib"