Re: [openstack-dev] [Cinder] Getting `ValueError: Field `volume_id' cannot be None`

2015-06-09 Thread Deepak Shetty
Thang, Thanks! Its still not clear to me why my method doesn't work. FWIW, i did try db.snapshot_get = mock.Mock(...) before and when that didn't work, i was just trying out with remotefs.db.snapshot_get with the assumption that maybe some scope issue is there hence I should try using the

Re: [openstack-dev] [Cinder] Getting `ValueError: Field `volume_id' cannot be None`

2015-06-09 Thread Deepak Shetty
Thangp, I have a related Question wrt your comment in https://review.openstack.org/#/c/172808/6/cinder/api/contrib/snapshot_actions.py Do i need to add support for snapshot_admin_metadata table in object/snapshot.py or I need to create a new object since its a new table, I am not clear on this,

Re: [openstack-dev] [Cinder] Getting `ValueError: Field `volume_id' cannot be None`

2015-06-09 Thread Thang Pham
It should be a field, e.g. admin_metadata, in the snapshot object under object/snapshot.py. Look at 'metadata' field as an example of how to accomplish this. Thang On Tue, Jun 9, 2015 at 11:06 AM, Deepak Shetty dpkshe...@gmail.com wrote: Thangp, I have a related Question wrt your comment

Re: [openstack-dev] [Cinder] Getting `ValueError: Field `volume_id' cannot be None`

2015-06-04 Thread Thang Pham
The problem is in your test case. There is no such methods as remotefs.db.snapshot_get or remotefs.db.snapshot_admin_metadata_get. You need to use with mock.patch('cinder.db.snapshot_get') as snapshot_get, mock.patch('cinder.db.snapshot_admin_metadata_get') as snapshot_admin_metadata_get. These

Re: [openstack-dev] [Cinder] Getting `ValueError: Field `volume_id' cannot be None`

2015-06-04 Thread Deepak Shetty
I was able to narrow down to the scenario where it fails only when i do: ./run_tests.sh -N cinder.tests.unit.test_remotefs cinder.tests.unit.test_volume.VolumeTestCase and fails with: {0} cinder.tests.unit.test_volume.VolumeTestCase.test_can_delete_errored_snapshot [0.507361s] ... FAILED

Re: [openstack-dev] [Cinder] Getting `ValueError: Field `volume_id' cannot be None`

2015-06-04 Thread Deepak Shetty
Hi Thang, Since you are working on Snapshot Objects, any idea on why the testcase when run all by itself, works, but when run as part of the overall suite, fails ? This seems to be related to the Snapshot Objects, hence Ccing you. On Wed, Jun 3, 2015 at 9:54 PM, Deepak Shetty

[openstack-dev] [Cinder] Getting `ValueError: Field `volume_id' cannot be None`

2015-06-03 Thread Deepak Shetty
Hi All, I am hitting a strange issue when running Cinder unit tests against my patch @ https://review.openstack.org/#/c/172808/5 I have spent 1 day and haven't been successfull at figuring how/why my patch is causing it! All tests failing are part of VolumeTestCase suite and from the error