def teardown(self): for node in self.__nodes: id = node.get('id') assert_is_not_none(id) try: Pollers().nodes_identifier_pollers_get(id) pollers = self.__get_data() for p in pollers: Pollers().pollers_identifier_delete(p.get('id')) Nodes().nodes_identifier_delete(id) except rest.ApiException as e: LOG.warning(e)
def redfish_pollers_test(self): """ Testing Redfish Pollers """ for node in self.__nodes: id = node.get('id') assert_is_not_none(id) Pollers().nodes_identifier_pollers_get(id) pollers = self.__get_data() assert_not_equal(len(pollers), 0, message='Unpexpected poller length') name = [] for p in pollers: if p.get('name') == 'Pollers.Redfish': name.append(p) assert_equal(len(pollers), len(name), \ message='Unexpected pollers found in Redfish enclosure')
def __handle_result(self, body, message): LOG.debug(body, json=True) assert_is_not_none(body) assert_is_not_none(message) id = body['value'].get('node') assert_is_not_none(id) for task in self.__tasks: if task.id == id: workId = body['value'].get('workItemId') assert_is_not_none(workId) Pollers().pollers_identifier_get(workId) poller = loads(self.__client.last_response.data) config = poller.get('config') assert_is_not_none(config) command = config.get('command') assert_is_not_none(command) LOG.info('Received message (nodeId={0}, workId={1}, command={2})' \ .format(id,workId,command)) message.ack() task.worker.stop() task.running = False