Example #1
0
 def build_entity(self):
     return otypes.Event(
         description=self._module.params['description'],
         severity=otypes.LogSeverity(self._module.params['severity']),
         origin=self._module.params['origin'],
         custom_id=self._module.params['custom_id'],
         id=self._module.params['id'],
         cluster=otypes.Cluster(
             id=self._module.params['cluster']
         ) if self._module.params['cluster'] is not None else None,
         data_center=otypes.DataCenter(
             id=self._module.params['data_center']
         ) if self._module.params['data_center'] is not None else None,
         host=otypes.Host(
             id=self._module.params['host']
         ) if self._module.params['host'] is not None else None,
         storage_domain=otypes.StorageDomain(
             id=self._module.params['storage_domain']
         ) if self._module.params['storage_domain'] is not None else None,
         template=otypes.Template(
             id=self._module.params['template']
         ) if self._module.params['template'] is not None else None,
         user=otypes.User(
             id=self._module.params['user']
         ) if self._module.params['user'] is not None else None,
         vm=otypes.Vm(
             id=self._module.params['vm']
         ) if self._module.params['vm'] is not None else None,
     )
Example #2
0
def test_invocation_logger(api, test_id):
    engine = api.system_service()
    events = engine.events_service()
    events.add(
        types.Event(
            comment='delimiter for test function invocation in engine log',
            custom_id=random.randrange(1, 2**31),
            description='OST invoked: ' + test_id,
            origin='OST-basic-suite',
            severity=types.LogSeverity(types.LogSeverity.NORMAL)))