- res_pool_id = resource.serialize()['resourcePoolId']
- logger.debug('res pool id is {}'.format(res_pool_id))
- if sub_data.get('filter', None):
- try:
- args = gen_orm_filter(ocloud.Resource, sub_data['filter'])
- except KeyError:
- logger.error(
- 'Subscription {} filter {} has wrong attribute name '
- 'or value. Ignore the filter.'.format(
- sub_data['subscriptionId'], sub_data['filter']))
- callback_smo(sub, data)
- continue
- args.append(ocloud.Resource.resourceId == data.id)
- ret = uow.resources.list_with_count(res_pool_id, *args)
- if ret[0] != 0:
- logger.debug(
- 'Resource {} skip for subscription {} because of the '
- 'filter.'
- .format(data.id, sub_data['subscriptionId']))
- continue
-