File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -1397,8 +1397,10 @@ class RBD(object):
13971397 char * _client_name = client_name
13981398 try :
13991399 _uuid = < char * > realloc_chk(_uuid, _uuid_max_length)
1400- ret = rbd_mirror_peer_site_add(_ioctx, _uuid, _uuid_max_length,
1401- _direction, _site_name, _client_name)
1400+ with nogil:
1401+ ret = rbd_mirror_peer_site_add(_ioctx, _uuid, _uuid_max_length,
1402+ _direction, _site_name,
1403+ _client_name)
14021404 if ret != 0 :
14031405 raise make_ex(ret, ' error adding mirror peer' )
14041406 return decode_cstr(_uuid)
@@ -3132,7 +3134,11 @@ cdef class Image(object):
31323134
31333135 :returns: int - the pool id
31343136 """
3135- return rbd_get_data_pool_id(self .image)
3137+ with nogil:
3138+ ret = rbd_get_data_pool_id(self .image)
3139+ if ret < 0 :
3140+ raise make_ex(ret, ' error getting data pool id for image %s ' % self .name)
3141+ return ret
31363142
31373143 @requires_not_closed
31383144 def get_parent_image_spec (self ):
Original file line number Diff line number Diff line change 1313from datetime import datetime , timedelta
1414from nose import with_setup , SkipTest
1515from nose .plugins .attrib import attr
16- from nose .tools import eq_ as eq , assert_raises , assert_not_equal
16+ from nose .tools import (eq_ as eq , assert_raises , assert_not_equal ,
17+ assert_greater_equal )
1718from rados import (Rados ,
1819 LIBRADOS_OP_FLAG_FADVISE_DONTNEED ,
1920 LIBRADOS_OP_FLAG_FADVISE_NOCACHE ,
@@ -607,6 +608,9 @@ def test_id(self):
607608 def test_block_name_prefix (self ):
608609 assert_not_equal (b'' , self .image .block_name_prefix ())
609610
611+ def test_data_pool_id (self ):
612+ assert_greater_equal (self .image .data_pool_id (), 0 )
613+
610614 def test_create_timestamp (self ):
611615 timestamp = self .image .create_timestamp ()
612616 assert_not_equal (0 , timestamp .year )
You can’t perform that action at this time.
0 commit comments