mock.sentinel.volume,
'test_suffix')
self.assertIsNone(output)
- mock_usage.assert_called_once_with(mock.sentinel.context,
- mock.sentinel.volume)
+ mock_usage.assert_called_once_with(mock.sentinel.volume)
mock_rpc.get_notifier.assert_called_once_with('volume', 'host1')
mock_rpc.get_notifier.return_value.info.assert_called_once_with(
mock.sentinel.context,
extra_usage_info={'a': 'b', 'c': 'd'},
host='host2')
self.assertIsNone(output)
- mock_usage.assert_called_once_with(mock.sentinel.context,
- mock.sentinel.volume, a='b', c='d')
+ mock_usage.assert_called_once_with(mock.sentinel.volume, a='b', c='d')
mock_rpc.get_notifier.assert_called_once_with('volume', 'host2')
mock_rpc.get_notifier.return_value.info.assert_called_once_with(
mock.sentinel.context,
mock.sentinel.volume,
'test_suffix')
self.assertIsNone(output)
- mock_usage.assert_called_once_with(mock.sentinel.context,
- mock.sentinel.volume)
+ mock_usage.assert_called_once_with(mock.sentinel.volume)
mock_rpc.get_notifier.assert_called_once_with('replication', 'host1')
mock_rpc.get_notifier.return_value.info.assert_called_once_with(
mock.sentinel.context,
extra_usage_info={'a': 'b', 'c': 'd'},
host='host2')
self.assertIsNone(output)
- mock_usage.assert_called_once_with(mock.sentinel.context,
- mock.sentinel.volume,
+ mock_usage.assert_called_once_with(mock.sentinel.volume,
a='b', c='d')
mock_rpc.get_notifier.assert_called_once_with('replication', 'host2')
mock_rpc.get_notifier.return_value.info.assert_called_once_with(
mock.sentinel.volume,
'test_suffix')
self.assertIsNone(output)
- mock_usage.assert_called_once_with(mock.sentinel.context,
- mock.sentinel.volume)
+ mock_usage.assert_called_once_with(mock.sentinel.volume)
mock_rpc.get_notifier.assert_called_once_with('replication', 'host1')
mock_rpc.get_notifier.return_value.error.assert_called_once_with(
mock.sentinel.context,
extra_error_info={'a': 'b', 'c': 'd'},
host='host2')
self.assertIsNone(output)
- mock_usage.assert_called_once_with(mock.sentinel.context,
- mock.sentinel.volume,
+ mock_usage.assert_called_once_with(mock.sentinel.volume,
a='b', c='d')
mock_rpc.get_notifier.assert_called_once_with('replication', 'host2')
mock_rpc.get_notifier.return_value.error.assert_called_once_with(
mock.sentinel.snapshot,
'test_suffix')
self.assertIsNone(output)
- mock_usage.assert_called_once_with(mock.sentinel.context,
- mock.sentinel.snapshot)
+ mock_usage.assert_called_once_with(mock.sentinel.snapshot)
mock_rpc.get_notifier.assert_called_once_with('snapshot', 'host1')
mock_rpc.get_notifier.return_value.info.assert_called_once_with(
mock.sentinel.context,
extra_usage_info={'a': 'b', 'c': 'd'},
host='host2')
self.assertIsNone(output)
- mock_usage.assert_called_once_with(mock.sentinel.context,
- mock.sentinel.snapshot,
+ mock_usage.assert_called_once_with(mock.sentinel.snapshot,
a='b', c='d')
mock_rpc.get_notifier.assert_called_once_with('snapshot', 'host2')
mock_rpc.get_notifier.return_value.info.assert_called_once_with(
'status': 'pause',
'deleted': '',
}
- usage_info = volume_utils._usage_from_snapshot(
- mock.sentinel.context,
- raw_snapshot)
+ usage_info = volume_utils._usage_from_snapshot(raw_snapshot)
expected_snapshot = {
'tenant_id': '12b0330ec2584a',
'user_id': '158cba1b8c2bb6008e',
mock.sentinel.consistencygroup,
'test_suffix')
self.assertIsNone(output)
- mock_usage.assert_called_once_with(mock.sentinel.context,
- mock.sentinel.consistencygroup)
+ mock_usage.assert_called_once_with(mock.sentinel.consistencygroup)
mock_rpc.get_notifier.assert_called_once_with('consistencygroup',
'host1')
mock_rpc.get_notifier.return_value.info.assert_called_once_with(
extra_usage_info={'a': 'b', 'c': 'd'},
host='host2')
self.assertIsNone(output)
- mock_usage.assert_called_once_with(mock.sentinel.context,
- mock.sentinel.consistencygroup,
+ mock_usage.assert_called_once_with(mock.sentinel.consistencygroup,
a='b', c='d')
mock_rpc.get_notifier.assert_called_once_with('consistencygroup',
'host2')
mock.sentinel.cgsnapshot,
'test_suffix')
self.assertIsNone(output)
- mock_usage.assert_called_once_with(mock.sentinel.context,
- mock.sentinel.cgsnapshot)
+ mock_usage.assert_called_once_with(mock.sentinel.cgsnapshot)
mock_rpc.get_notifier.assert_called_once_with('cgsnapshot', 'host1')
mock_rpc.get_notifier.return_value.info.assert_called_once_with(
mock.sentinel.context,
extra_usage_info={'a': 'b', 'c': 'd'},
host='host2')
self.assertIsNone(output)
- mock_usage.assert_called_once_with(mock.sentinel.context,
- mock.sentinel.cgsnapshot,
+ mock_usage.assert_called_once_with(mock.sentinel.cgsnapshot,
a='b', c='d')
mock_rpc.get_notifier.assert_called_once_with('cgsnapshot', 'host2')
mock_rpc.get_notifier.return_value.info.assert_called_once_with(
return str(s) if s else ''
-def _usage_from_volume(context, volume_ref, **kw):
+def _usage_from_volume(volume_ref, **kw):
usage_info = dict(
tenant_id=volume_ref['project_id'],
host=volume_ref['host'],
return usage_info
-def _usage_from_backup(context, backup_ref, **kw):
+def _usage_from_backup(backup_ref, **kw):
usage_info = dict(tenant_id=backup_ref['project_id'],
user_id=backup_ref['user_id'],
availability_zone=backup_ref['availability_zone'],
if not extra_usage_info:
extra_usage_info = {}
- usage_info = _usage_from_volume(context, volume, **extra_usage_info)
+ usage_info = _usage_from_volume(volume, **extra_usage_info)
rpc.get_notifier("volume", host).info(context, 'volume.%s' % event_suffix,
usage_info)
if not extra_usage_info:
extra_usage_info = {}
- usage_info = _usage_from_backup(context, backup, **extra_usage_info)
+ usage_info = _usage_from_backup(backup, **extra_usage_info)
rpc.get_notifier("backup", host).info(context, 'backup.%s' % event_suffix,
usage_info)
-def _usage_from_snapshot(context, snapshot_ref, **extra_usage_info):
+def _usage_from_snapshot(snapshot_ref, **extra_usage_info):
usage_info = {
'tenant_id': snapshot_ref['project_id'],
'user_id': snapshot_ref['user_id'],
if not extra_usage_info:
extra_usage_info = {}
- usage_info = _usage_from_snapshot(context, snapshot, **extra_usage_info)
+ usage_info = _usage_from_snapshot(snapshot, **extra_usage_info)
rpc.get_notifier('snapshot', host).info(context,
'snapshot.%s' % event_suffix,
if not extra_usage_info:
extra_usage_info = {}
- usage_info = _usage_from_volume(context,
- volume,
+ usage_info = _usage_from_volume(volume,
**extra_usage_info)
rpc.get_notifier('replication', host).info(context,
if not extra_error_info:
extra_error_info = {}
- usage_info = _usage_from_volume(context,
- volume,
+ usage_info = _usage_from_volume(volume,
**extra_error_info)
rpc.get_notifier('replication', host).error(context,
usage_info)
-def _usage_from_consistencygroup(context, group_ref, **kw):
+def _usage_from_consistencygroup(group_ref, **kw):
usage_info = dict(tenant_id=group_ref['project_id'],
user_id=group_ref['user_id'],
availability_zone=group_ref['availability_zone'],
if not extra_usage_info:
extra_usage_info = {}
- usage_info = _usage_from_consistencygroup(context,
- group,
+ usage_info = _usage_from_consistencygroup(group,
**extra_usage_info)
rpc.get_notifier("consistencygroup", host).info(
usage_info)
-def _usage_from_cgsnapshot(context, cgsnapshot_ref, **kw):
+def _usage_from_cgsnapshot(cgsnapshot_ref, **kw):
usage_info = dict(
tenant_id=cgsnapshot_ref['project_id'],
user_id=cgsnapshot_ref['user_id'],
if not extra_usage_info:
extra_usage_info = {}
- usage_info = _usage_from_cgsnapshot(context,
- cgsnapshot,
+ usage_info = _usage_from_cgsnapshot(cgsnapshot,
**extra_usage_info)
rpc.get_notifier("cgsnapshot", host).info(