4471 Commits

Author SHA1 Message Date
OpenStack Proposal Bot
193dd3032f Updated from global requirements
Change-Id: I76c5eba2f3cd39ec55390ea69071e0545858f68c
2015-12-11 15:24:42 +00:00
OpenStack Proposal Bot
39bcfd1767 Updated from global requirements
Change-Id: I49d27ba176ade7ed4bcf29042642642786b2c78a
2015-12-09 22:00:29 +00:00
Jenkins
6197e6eedc Merge "Trival: Remove 'MANIFEST.in'" 2015-12-09 15:31:12 +00:00
Jenkins
ffc9a53eed Merge "Clean up directory openstack/common" 2015-12-09 15:31:09 +00:00
Jenkins
92524640b3 Merge "Use method is_compatible from olso_utils.versionutils" 2015-12-09 15:19:42 +00:00
Jenkins
af5954e479 Merge "Use version convert methods from oslo_utils.versionutils" 2015-12-09 10:48:51 +00:00
Jenkins
85f1e170be Merge "Leverage dict comprehension in PEP-0274" 2015-12-09 10:48:23 +00:00
ChangBo Guo(gcb)
4cdab4b3a0 Clean up directory openstack/common
We don't use anyhting from directory openstack/common any more,
so clean up related stuff.

Change-Id: I103477135a848107c70a222f28e842026b50313c
2015-12-09 17:59:31 +08:00
ChangBo Guo(gcb)
0431b52d8f Use method is_compatible from olso_utils.versionutils
oslo_utils.versionutils provides exact same method is_compatible,
Let's use it.

Change-Id: I638f6de3a585d7e78bbb9784ef430a5af0fbf06e
2015-12-09 17:48:35 +08:00
Jenkins
371a445957 Merge "Add a callable to gather extra data for fps" 2015-12-08 20:13:21 +00:00
ChangBo Guo(gcb)
cf9c245152 Trival: Remove 'MANIFEST.in'
Everything in this file is automatically generated by pbr. There
appears to be no good reason to keep it around.
More details please see:
https://github.com/openstack-dev/pbr/blob/master/pbr/packaging.py#L384

Change-Id: I4fb90bc0a2a18f0edd7012a76c961d6960205623
2015-12-05 13:38:41 +08:00
Jenkins
37df38450d Merge "Add testing for ObjectVersionChecker fixture" 1.1.0 2015-12-03 21:20:25 +00:00
Ryan Rossiter
b881872086 Add a callable to gather extra data for fps
ObjectVersionChecker gathers a group of relevant data with which it then
generates a fingerprint. This change adds a callable to get_hashes() to
provide the object class, which the callable can then use to gather more
data upon which it wants the fingerprint to be generated. This allows
end users to version on more than just fields and methods.

Change-Id: Ibbaaf926d50693ed0ddd96132542830dba75a285
2015-12-02 20:05:23 +00:00
Ryan Rossiter
2476f43a4b Add testing for ObjectVersionChecker fixture
This change adds testing infra for the fixture module, and starts out by
adding tests for the ObjectVersionChecker fixture.

Change-Id: I3057cbba6eddaddea2d8287e3f1a21eaf31104fc
2015-12-02 14:49:34 +00:00
ChangBo Guo(gcb)
b524bf5b71 Leverage dict comprehension in PEP-0274
PEP-0274 introduced dict comprehensions to replace dict constructor
with a sqeuence of key-pairs[1], these are benefits:
  First, it makes the code look neater.
  Second, it gains a micro-optimization.

We dropped python 2.6 support, we can leverage this now.
Note: This commit doesn't handle dict constructor with kwargs.

[1]http://legacy.python.org/dev/peps/pep-0274/

Change-Id: Ifca656d516809a6a52cf15bac3f6361e8d83aa58
2015-12-02 16:35:16 +08:00
Jenkins
ab0a66e16a Merge "Remove remote_object_calls from _BaseTestCase" 2015-12-02 05:05:30 +00:00
ChangBo Guo(gcb)
a9752e281a Use version convert methods from oslo_utils.versionutils
oslo_utils provide version convert methods in versionutis[1],
these methods work well on Python 2.7 and Python 3.4,
so don't need maintain them.

[1]https://github.com/openstack/oslo.utils/blob/master/oslo_utils/versionutils.py

Change-Id: Ifc4b7f5c7e42bce9f5bbf8a961fd32506cca98eb
2015-12-01 00:26:55 +08:00
Jenkins
cad06aa85f Merge "Add netaddr-related field types" 1.0.0 2015-11-21 02:17:26 +00:00
Jenkins
e7559da987 Merge "Adds new MACAddressField" 2015-11-20 20:05:31 +00:00
Dan Smith
227a0bcee9 Add netaddr-related field types
This brings over the network-related fields from Nova.

Change-Id: I6db660bdda043477da4ee61947c9114696734c3d
2015-11-20 10:51:43 -08:00
OpenStack Proposal Bot
687db68879 Updated from global requirements
Change-Id: I038551f901e640924e576adc0cf02493081c0572
2015-11-19 16:00:42 +00:00
Jay Pipes
24d330f53d Adds new MACAddressField
This patch adds another field type definition to o.vo for a MAC Address.

Change-Id: Iee44223e5eff5565cc5e02571e5a96bb29490925
Co-authored-by: Dan Berrange <berrange@redhat.com>
2015-11-17 18:15:20 -08:00
Kai Qiang Wu
ce00f18f7e Fix the wrong reference for DeprecationWarning
warnings module not have such attribute, so we need use built-in
exceptions https://docs.python.org/2/library/warnings.html

Change-Id: I41e0c5ecfecc6e30855c722dd4c4f3fe68fbcf27
Closes-Bug: #1517280
2015-11-17 20:11:57 -06:00
Jenkins
0fb6b894a9 Merge "cleanup tox.ini" 2015-11-17 12:30:36 +00:00
Davanum Srinivas
8116ef9376 cleanup tox.ini
* Remove skipsdist : Needs to be set only if 
  sdist is expensive
* Remove usedevelop : only needed when skipsdist 
  is set to True
* Remove install_command : We can just use the 
  default, we don't need to override
* Remove setenv : We can just use the default as
  we don't need any extra environment variables

Change-Id: Idb0a475054743fa716c7948e974a7268862c74c7
2015-11-16 00:41:17 +00:00
OpenStack Proposal Bot
adb21b4d24 Updated from global requirements
Change-Id: Ifdbf9cab474d0bae176a582e765e0bbf9f72e806
2015-11-13 17:15:32 +00:00
OpenStack Proposal Bot
d7520a2483 Updated from global requirements
Change-Id: I61af035b2735b7b7666054949a14f29ca386a2b6
0.13.0
2015-11-11 17:23:41 +00:00
Matt Riedemann
40b3a683d5 Remove remote_object_calls from _BaseTestCase
The variable is no longer used so remove it.

Change-Id: I24fe19daf6a5c8d234794f28073fd069101d9a11
2015-11-10 13:56:57 -08:00
Liang Chen
f5e792a983 Ensure__repr__ return value is encoded
When __repr__ returns an unicode object, python will
try to encode it with the default encoding scheme
which is ascii in general. So __repr__ needs to make
sure its return value is properly encoded.

Change-Id: Ifdb8c073474a917207a48fc5af5a340e87f66fc4
Closes-Bug: #1514325
2015-11-09 17:47:32 +08:00
Jenkins
f71c7a732e Merge "Add SensitiveString field type" 2015-11-08 17:20:00 +00:00
Matt Riedemann
d0b2b55540 Cleanup docstring for obj_tree_get_versions
Fixes a typo and fixes the parameters formatting so it shows
up nice and purdy when rendered.

Change-Id: I2b167937c58b7fbbb0cb854e346029f38d890b41
2015-10-29 06:39:42 -07:00
Jenkins
d20ed0613f Merge "Add warnings for deprecated IndirectionAPI methods" 2015-10-28 07:03:58 +00:00
Jenkins
b9a66b7e5a Merge "Make tests properly use object_class_action_versions()" 2015-10-28 06:58:49 +00:00
Jenkins
1a10fae7d9 Merge "Make class action calls use version manifest" 2015-10-28 06:56:33 +00:00
OpenStack Proposal Bot
0189824e24 Updated from global requirements
Change-Id: I6252694e188a2279183c2a4066ac2cb682761f2a
2015-10-23 18:49:07 +00:00
OpenStack Proposal Bot
5010aa4697 Imported Translations from Zanata
For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure

Change-Id: I6cd1bfc5cddf2f0be137fbbbba124530b2097612
2015-10-23 06:11:03 +00:00
Dan Smith
7ca1019890 Add warnings for deprecated IndirectionAPI methods
This adds some warnings and comments when we encounter unsupported
IndirectionAPI methods for manifest-based operations.

Change-Id: I9a75d887723a0fd375041dfcba37108ae032b3bd
2015-10-20 11:18:56 -07:00
Dan Smith
c85f3bb785 Make tests properly use object_class_action_versions()
This also includes a new test to validate that the fallback behavior
still works.

Change-Id: Id85cbd837774a8fe8ec4f0631f57c3421cef54e4
2015-10-20 11:18:56 -07:00
Dan Smith
fa7b1afb92 Make class action calls use version manifest
This follows the object_backport_versions() change by also making the
class action calls pass a version manifest. This is done in a compatible
way by first trying the new method, and if unsupported, falling back
to the original method.

No tests are changed here specifically to demonstrate that they are
undisturbed by this change. Proper tests are next.

Change-Id: If9a158fbd345b56b26ebbe2a0733db55f4929ea1
2015-10-20 11:18:53 -07:00
OpenStack Proposal Bot
f320e670f9 Updated from global requirements
Change-Id: I4c95da88b0ad0dbea56ae7c48b39b5b1e85e397e
2015-10-19 23:32:13 +00:00
OpenStack Proposal Bot
9261f3ae36 Updated from global requirements
Change-Id: Ia9b8b9b29828ebae52b587aa27770bc394ef1bf9
0.12.0
2015-10-16 01:00:14 +00:00
OpenStack Proposal Bot
b44f755e8b Updated from global requirements
Change-Id: I26ff793a8628c3fc07bec7b704cf48eadccfb94c
2015-10-15 15:44:41 +00:00
OpenStack Proposal Bot
b2725a822f Updated from global requirements
Change-Id: Id896ddcb467da1e6d67fb1ae52c78c5ca6506cd4
2015-10-14 09:32:46 +00:00
OpenStack Proposal Bot
132d0787df Updated from global requirements
Change-Id: I1176c54c4df4b5e5331716a7d11bc72e51671b54
2015-10-13 01:01:03 +00:00
OpenStack Proposal Bot
db4583c25b Updated from global requirements
Change-Id: Iba6a2df074e843eb9c2b735559462c573d507660
2015-10-12 21:15:13 +00:00
Dan Smith
6d57394a89 Fix obj_to_primitive() when using manifests (list version)
This is the logical continuation of a previous change:
I27b8a13dadc11b78c890b54eaeb9eb728125977a. That skipped the
equivalent change for the list objects, which this adds.

Change-Id: I6af7e792cc68ec1349026beee200494bae528625
0.11.0
2015-10-09 09:29:15 -07:00
Matt Riedemann
bd977f400a Add SensitiveString field type
There are objects that define a String field to hold a serialized json
blob and that blob can have sensitive information in it (tokens,
passwords, etc). When the object is logged, repr will log that sensitive
information. This puts a burden on the code that's doing the logging to
remember to sanitize the object's string form before logging it.

It'd be simpler and cleaner to just have a field type that extends
String so it's the same in all respects except for when it's
stringified. So in SensitiveString's stringify method it just masks the
password on the field value before returning it.

And no SensitiveString does not play an acoustic guitar at your local
coffee shop, he's actually super tough and emotionally walled up, that's
why he doesn't like exposing too much information about himself in the
logs.

Closes-Bug: #1321785

Change-Id: I56466eb8b5d8000ef010f2015f453a9e74dc66b8
2015-10-09 09:05:33 -07:00
Dan Smith
e8a758907b Fix obj_to_primitive() when used with a manifest
Previously, we required any child object version bump to come with a
bump to any objects that included it as a parent. That allowed us to use
the version of the object at the top of a tree to determine whether we
should do a backport as part of a to_primitive operation. With manifests,
that's no longer the case. So, if we have been requested a version other
than the current one, OR if we have a manifest, we need to run the make-
compatible step. We will end up doing this all the tiem now, but it should
be very quick if nothing needs backporting.

Change-Id: I27b8a13dadc11b78c890b54eaeb9eb728125977a
2015-10-06 11:20:19 -07:00
Jenkins
a8d7e83cc7 Merge "Fix coverage configuration and execution" 2015-10-06 14:01:19 +00:00
Matt Riedemann
7b67b8540b Move __contains__ from VersionedObjectDictCompat to VersionedObject
VersionedObject is a container so having __contains__ implemented is
nice when your object class doesn't extend VersionedObjectDictCompat.

Since you can't use the VersionedObjectDictCompat mixin without the
VersionedObject base class we just move the __contains__ method rather
than copy it.

This came up in I95e543415b881603bb997ae0e159017c03e58a53 because:

if 'disk_format' in image_meta:

is prettier than:

if image_meta.obj_attr_is_set('disk_format'):

--

test_contains is updated to use MyOwnedObject since we need a test class
that is a VersionedObject but does not have VersionedObjectDictCompat and
it needs to be a class that defines at least one field.

Change-Id: I4f03c8e9e7827aa45225c9cfd83966ac4f01e503
2015-10-05 07:48:07 -07:00