16 Commits

Author SHA1 Message Date
root
01ed01db34 CGSnapshot Object
This patch adds VersionedObjects abstraction layer to CGSnapshots.

Co-Authored-By: Szymon Wroblewski <szymon.wroblewski@intel.com>
Co-Authored-By: Michal Dulko <michal.dulko@intel.com>

Partial-Implements: blueprint cinder-objects
Change-Id: Ie4cdd1ffae15a93bff756ad278ca680f9f420748
2015-10-19 14:37:39 +02:00
Michal Dulko
074ef95c2a Add ConsistencyGroup object entries to linstack.py
Change I3febb95bb2b3dd8f10da4f01ffa705e39cb20520 wasn't passing pylint
gate because of missing objects_ignore_messages entries in linstack.py.
This commits adds these entries.

Change-Id: I9e42a065d6584b445f2fed8995de32adbea7739b
Closes-Bug: 1493905
2015-09-09 17:20:18 +02:00
Gorka Eguileor
dbdb4cda00 Fix backup metadata import missing fields
When importing backup metadata only required fields were being imported,
and all other fields were being ignored.

This led to some serious problems when importing backups back, since
you would lose not only the original Volume ID, but also relevant parent
id information needed to restore incremental backups.

This patch fixes this by importing everything back and creating backup
records with the right ID.

Closes-Bug: #1455043
Closes-Bug: #1476416
Depends-On: Id7ab6e174c1fe85772477f03059c4f457c5c8b17
Change-Id: Ia42ba73e9078d993c63f8e16308151ad11721ea9
2015-09-01 15:26:44 +02:00
Michal Dulko
94ab085779 Service object
Add versionedobjects abstraction layer to services. Distinguish time
zone aware DateTime fields. The object derives from
CinderObjectDictCompat, so it supports both object (obj.prop) and dict
(obj['prop']) syntax to access properties. Complete move to object
notation will be made in a follow up clean up patch.

Co-Authored-By: Michal Dulko <michal.dulko@intel.com>

Change-Id: I09f593f9f9aa8befa40d989b731159b78a429071
Partial-Implements: blueprint cinder-objects
2015-09-01 07:09:08 +00:00
Anton Arefiev
5f8a616b15 Fix 033 add encryption unique key migration
SQLite doesn't support 'drop constraint' statament. So it notifies:
SAWarning: Table 'encryption' specifies columns 'volume_type_id'
as primary_key=True, not matching locally specified columns
'encryption_id'; setting the current primary key columns to
'encryption_id'. This warning may become an exception in a future
release.

Add new strategy for sqlite upgrade: table is renamed to temporary
name, new table is created followed by INSERT statements, and
renamed to original one.

Change-Id: I723fdadb946f6944dde03954409899a9ddc3ee0e
Closes-Bug: #1431374
2015-07-21 11:47:10 +03:00
Michal Dulko
0e76126136 Backup object
This patch adds VersionedObjects abstraction layer to volume backups.
The object derives from CinderObjectDictCompat, so it supports both
object (obj.prop) and dict (obj['prop']) syntax to access properties.
Complete move to object notation will be made in a follow up clean up
patch.

Co-Authored-By: Grzegorz Grasza <grzegorz.grasza@intel.com>

Change-Id: Icff37261b367463b71a1268be16f9c97f595bf0c
Partial-Implements: blueprint cinder-objects
2015-06-18 10:17:53 +02:00
Thang Pham
b8a58fb01f Switch get_all_snapshots to use objects
The following patch switches direct db calls in
volume/api.py get_all_snapshots to use SnapshotList
instead.

Partial-Implements: blueprint cinder-objects
Change-Id: Ifdccc81a087f9797fcfbf098d3ecea3875ad7bd9
2015-06-01 09:26:05 +08:00
Thang Pham
21cda264dd Snapshot and volume objects
Abstract volumes and volume snapshots into objects.
Get, create, and delete snapshot APIs were changed to
use new snapshot objects.  A skeleton volume object was
created, but cinder internals were not changed to use
the volume object, although volume is referenced and
used by the snapshot object.  The internals will be
changed to use volume object in a subsequent patch.

Change-Id: I387018e80c8539565e99454db65d976030002c0f
Implements: blueprint cinder-objects
2015-03-01 17:47:54 -05:00
Thang Pham
2b4c8e79ec Cinder objects base
This patch is to insert the objects code base, currently based
on nova.objects.  It will be later based on
oslo_versionedobjects once it is available.  This is done
to make progress on changing cinder internals to use objects,
since nova.objects and oslo.versionedobjects are similar.

Inserted objects code base into cinder and modified cinder services
to use object-aware serializer.

Change-Id: I42a6cc43da19ca29db4cfb33cbf794afed18f758
Implements: blueprint cinder-objects
2015-03-01 17:47:54 -05:00
Xing Yang
e516f9af83 Ignore pylint error 'hashlib' has no shaxxx member
The following pylint error was found:

cinder/backup/drivers/swift.py:486: [E1101, SwiftBackupDriver.backup]
Module 'hashlib' has no 'sha256' member

Affected patch:
https://review.openstack.org/#/c/110068/

A similar pylint error "Module 'hashlib' has no 'sha224' member"
was also generated.

However, both 'sha256' and 'sha224' are functions in 'hashlib'.  So
these errors should be ignored.

Change-Id: I84690813b6c6a15e661e27acdf97149996951978
2014-08-29 12:18:06 -04:00
Ivan Kolodyazhny
5a86bbaa1e Ignore No value passed for parameter 'dml' message
There are a lot false positive PyLint errors on
DB migrations for table update method

Change-Id: Id033a1f5af04cde4d8bd888e01bfcc48e656a252
2014-08-18 22:37:15 +03:00
Fengqian Gao
2fad54233d Use six.moves.urllib.parse instead of urlparse
To keep Python 3.x compatibility, use six.moves.urllib.parse to
replace urlparse. tools/lintstack is changed to pass pylint test.

Partial-Bug: #1279611

Change-Id: I0ceaaccbf6c67b45609b4f2f5639c362b32d10ad
2014-03-14 13:17:28 +08:00
He Yongli
6427b5506d Use six.moves cStringIO instead of cStringIO
to keep Python 3.x compatibility, use six.moves.cStringIO to
replace StringIO

Change-Id: Id89c6156d9bba0007e8b16cd2cc28413a7cc5fd3
Closes-Bug: #1280964
2014-02-17 15:13:49 +08:00
DennyZhang
ff3f2e5735 Remove vim header
No need to set tabstop tons of times, this can be set in your vimrc
file instead.

More disucssion:
http://openstack.10931.n7.nabble.com/Remove-vim-modelines-td21780.html

Partial-Bug: #1229324
Change-Id: Ib3a31c8819ee1950d72f7da5627593623d351560
2013-12-30 18:53:02 -06:00
John Griffith
878ac164a3 Fix python 3 pep8 errors for print
The new auto-pulled requirements files exposed
python 3 compat issues in a number of modules.
We added these to tox.ini ignore temporarily,
this change updates the print routines in bin/cinder
and removes the debug cruft that was in the unit tests.

Will update requirements and test-requirements
appropriately in a follow up patch.

Change-Id: I76ea24f4dc1f61c4f8a1d202b0554c90daf2c9cc
2013-08-21 16:59:22 -06:00
Yun Mao
d75fafa88f Add pylint-based lintstack test to tox environment
lintstack is a pylint-based static analysis tool to find bugs
in Python code.

To run the test via tox: $ tox -e pylint
To run the test directly: $ tools/lintstack.sh

Change-Id: If155f47ed84eb820ac505ee741bdd18edd41b1eb
2013-05-10 07:22:05 -04:00