def common_meta_backup_mocks(f):
 def _common_inner_inner1(inst, *args, **kwargs):
  @mock.patch('cinder.backup.drivers.ceph.rbd')
  @mock.patch('cinder.backup.drivers.ceph.rados')
  def _common_inner_inner2(mock_rados, mock_rbd):
   inst.mock_rados = mock_rados
   inst.mock_rbd = mock_rbd
   inst.mock_rados.ObjectNotFound = MockObjectNotFoundException
   return f(inst, *args, **kwargs)
  return _common_inner_inner2()
 return _common_inner_inner1

def common_meta_backup_mocks ( f ) : def _common_inner_inner1 ( inst , * args , ** kwargs ) : @ mock . patch ( 'cinder.backup.drivers.ceph.rbd' ) @ mock . patch ( 'cinder.backup.drivers.ceph.rados' ) def _common_inner_inner2 ( mock_rados , mock_rbd ) : inst . mock_rados = mock_rados inst . mock_rbd = mock_rbd inst . mock_rados . ObjectNotFound = MockObjectNotFoundException return f ( inst , * args , ** kwargs ) return _common_inner_inner2 ( ) return _common_inner_inner1
decorator to set mocks common to all metadata backup tests .