misc typo and docstring fix
Change-Id: I80819413759b4ffdda75a87beddc5dab1adc6bd3
This commit is contained in:
parent
feb2c777b6
commit
34e9e3cc16
@ -96,7 +96,7 @@ tuple with the following details:
|
||||
|
||||
Note that for every driver there should be a matching Transformer.
|
||||
A transformer should inherit from
|
||||
``vitrage.datasoures.transformer_base.TransformerBase`` class and
|
||||
``vitrage.datasources.transformer_base.TransformerBase`` class and
|
||||
must implement the following methods:
|
||||
|
||||
+----------------------------------+------------------------------------+----------------------------------------+
|
||||
|
@ -53,7 +53,7 @@ Let's take a basic template as example
|
||||
action_target:
|
||||
target: resource
|
||||
|
||||
``TemplateData`` will build ``entites``, ``relationships`` and most importantly
|
||||
``TemplateData`` will build ``entities``, ``relationships`` and most importantly
|
||||
``scenarios`` out from the definition.
|
||||
|
||||
.. code-block:: python
|
||||
|
@ -28,7 +28,7 @@ Zabbix web ui configuration
|
||||
|
||||
To forward zabbix events to Vitrage a new media script needs to be created and associated with a user. Follow the steps below as a Zabbix Admin user:
|
||||
|
||||
1. Create a new media type [Admininstration > Media Types > Create Media Type]
|
||||
1. Create a new media type [Administration > Media Types > Create Media Type]
|
||||
|
||||
| **Name:** Vitrage Notifications
|
||||
| **Type:** Script
|
||||
|
@ -93,15 +93,15 @@ def _create_query_expression(query, parent_operator=None):
|
||||
# Recursion evaluate leaf (stop condition)
|
||||
elif parent_operator in operators:
|
||||
for key, val in query.items():
|
||||
expressions.append('item.get(' + _evaluatable_str(key) + ')' +
|
||||
parent_operator + ' ' + _evaluatable_str(val))
|
||||
expressions.append('item.get(' + _evaluable_str(key) + ')' +
|
||||
parent_operator + ' ' + _evaluable_str(val))
|
||||
return _join_logical_operator('and', expressions)
|
||||
else:
|
||||
raise VitrageError('invalid partial query format',
|
||||
parent_operator, query)
|
||||
|
||||
|
||||
def _evaluatable_str(value):
|
||||
def _evaluable_str(value):
|
||||
"""wrap string/unicode with back tick"""
|
||||
if isinstance(value, six.string_types):
|
||||
return '\'' + value + '\''
|
||||
|
@ -65,7 +65,7 @@ class SnmpSender(SnmpSenderBase):
|
||||
self._get_var_binds(alarm_data),
|
||||
alarm_oid)
|
||||
else:
|
||||
LOG.info('Vitrage snmp Info: Unregconized alarm. Alarm type: %s',
|
||||
LOG.info('Vitrage snmp Info: Unrecognized alarm. Alarm type: %s',
|
||||
alarm_data[VProps.NAME])
|
||||
|
||||
def _get_details(self, alarm_data):
|
||||
|
@ -324,7 +324,7 @@ class TestApis(TestEntityGraphUnitBase):
|
||||
|
||||
# Test assertions
|
||||
self.assertIsNotNone(resource)
|
||||
self._check_resource_propeties(resource, 'zone_1',
|
||||
self._check_resource_properties(resource, 'zone_1',
|
||||
NOVA_ZONE_DATASOURCE)
|
||||
|
||||
def test_resource_show_with_not_admin_and_no_project_resource(self):
|
||||
@ -351,7 +351,7 @@ class TestApis(TestEntityGraphUnitBase):
|
||||
|
||||
# Test assertions
|
||||
self.assertIsNotNone(resource)
|
||||
self._check_resource_propeties(resource, 'instance_2',
|
||||
self._check_resource_properties(resource, 'instance_2',
|
||||
NOVA_INSTANCE_DATASOURCE,
|
||||
project_id='project_1')
|
||||
|
||||
@ -379,7 +379,7 @@ class TestApis(TestEntityGraphUnitBase):
|
||||
|
||||
# Test assertions
|
||||
self.assertIsNotNone(resource)
|
||||
self._check_resource_propeties(resource, 'instance_2',
|
||||
self._check_resource_properties(resource, 'instance_2',
|
||||
NOVA_INSTANCE_DATASOURCE,
|
||||
project_id='project_1')
|
||||
|
||||
@ -395,7 +395,7 @@ class TestApis(TestEntityGraphUnitBase):
|
||||
|
||||
# Test assertions
|
||||
self.assertIsNotNone(resource)
|
||||
self._check_resource_propeties(resource, 'instance_2',
|
||||
self._check_resource_properties(resource, 'instance_2',
|
||||
NOVA_INSTANCE_DATASOURCE,
|
||||
project_id='project_1')
|
||||
|
||||
@ -415,7 +415,7 @@ class TestApis(TestEntityGraphUnitBase):
|
||||
(tmp_project_id and tmp_project_id == project_id))
|
||||
self.assertEqual(True, condition)
|
||||
|
||||
def _check_resource_propeties(self, resource, vitrage_id,
|
||||
def _check_resource_properties(self, resource, vitrage_id,
|
||||
resource_type, project_id=None):
|
||||
self.assertEqual(resource[VProps.VITRAGE_ID], vitrage_id)
|
||||
self.assertEqual(resource[VProps.ID], vitrage_id)
|
||||
|
@ -253,8 +253,7 @@ def simple_stack_generators(stack_num, instance_and_volume_num,
|
||||
:param update_vals: number of values from update event
|
||||
:param update_events: number of events from update event
|
||||
:param stack_num: number of stacks
|
||||
:param volume_num: number of volumes
|
||||
:param instance_num: number of instances
|
||||
:param instance_and_volume_num: number of volumes and instances
|
||||
:param snapshot_events: number of snapshot events per host
|
||||
:param snap_vals: preset vals for ALL snapshot events
|
||||
:return: generators for volume_num volumes as specified
|
||||
@ -299,7 +298,7 @@ def simple_consistency_generators(consistency_num, update_events=0,
|
||||
|
||||
:param update_vals: number of values from update event
|
||||
:param update_events: number of events from update event
|
||||
:param consistency_num: number of consisteny events
|
||||
:param consistency_num: number of consistency events
|
||||
:param snap_vals: preset vals for ALL snapshot events
|
||||
:return: generators for consistency_num consistency events as specified
|
||||
"""
|
||||
|
@ -121,7 +121,7 @@ class ZabbixDriverTest(ZabbixBaseTest):
|
||||
self._assert_contains(expected_alarm2, alarms)
|
||||
|
||||
# Step 4 - Check inactive alarms. Get all function should return
|
||||
# inactive alarm (alarm that teir status has changed to OK)
|
||||
# inactive alarm (alarm that its status has changed to OK)
|
||||
# Test setup
|
||||
alarm_data1 = self._extract_alarm_data()
|
||||
alarm_data2 = self._extract_alarm_data(z_resource_name='compute-2')
|
||||
|
Loading…
Reference in New Issue
Block a user