Ejemplo n.º 1
0
 def test_prefix_everything(self):
     node_info = node.Node(mock.Mock(), dict(uuid='NNN'))
     data = {'boot_interface': '01-aa-bb-cc-dd-ee-ff',
             'inventory': {'bmc_address': '1.2.3.4'}}
     self.assertEqual('[node: NNN MAC aa:bb:cc:dd:ee:ff BMC 1.2.3.4]',
                      utils.processing_logger_prefix(node_info=node_info,
                                                     data=data))
Ejemplo n.º 2
0
 def test_prefix_NodeInfo_instance(self):
     node_info = node_cache.NodeInfo('NNN')
     self.assertEqual('[node: NNN state None]',
                      utils.processing_logger_prefix(node_info=node_info))
Ejemplo n.º 3
0
 def test_prefix_uuid_not_str(self):
     node_info = node.Node(mock.Mock(), dict(uuid=None))
     self.assertEqual('[node: None]',
                      utils.processing_logger_prefix(node_info=node_info))
Ejemplo n.º 4
0
 def test_prefix_only_mac(self):
     data = {'boot_interface': '01-aa-bb-cc-dd-ee-ff'}
     self.assertEqual('[node: MAC aa:bb:cc:dd:ee:ff]',
                      utils.processing_logger_prefix(data=data))
Ejemplo n.º 5
0
 def test_prefix_only_uuid(self):
     node_info = node.Node(mock.Mock(), dict(uuid='NNN'))
     self.assertEqual('[node: NNN]',
                      utils.processing_logger_prefix(node_info=node_info))
Ejemplo n.º 6
0
 def test_prefix_only_bmc(self):
     data = {'inventory': {'bmc_address': '1.2.3.4'}}
     self.assertEqual('[node: BMC 1.2.3.4]',
                      utils.processing_logger_prefix(data=data))
Ejemplo n.º 7
0
 def test_prefix_NodeInfo_instance_with_state(self):
     node_info = node_cache.NodeInfo('NNN', state='foobar')
     self.assertEqual('[node: NNN state foobar]',
                      utils.processing_logger_prefix(node_info=node_info))
Ejemplo n.º 8
0
 def test_prefix_no_info(self):
     self.assertEqual('[unidentified node]',
                      utils.processing_logger_prefix())
Ejemplo n.º 9
0
 def test_prefix_no_info(self):
     self.assertEqual('[unidentified node]',
                      utils.processing_logger_prefix())
Ejemplo n.º 10
0
 def test_prefix_only_uuid(self):
     node_info = node.Node(mock.Mock(), dict(uuid='NNN'))
     self.assertEqual('[node: NNN]',
                      utils.processing_logger_prefix(node_info=node_info))
Ejemplo n.º 11
0
 def test_prefix_NodeInfo_instance_with_state(self):
     node_info = node_cache.NodeInfo('NNN', state='foobar')
     self.assertEqual('[node: NNN state foobar]',
                      utils.processing_logger_prefix(node_info=node_info))
Ejemplo n.º 12
0
 def test_prefix_NodeInfo_instance(self):
     node_info = node_cache.NodeInfo('NNN')
     self.assertEqual('[node: NNN]',
                      utils.processing_logger_prefix(node_info=node_info))
Ejemplo n.º 13
0
 def test_prefix_uuid_not_str(self):
     node_info = node.Node(mock.Mock(), dict(uuid=None))
     self.assertEqual('[node: None]',
                      utils.processing_logger_prefix(node_info=node_info))
Ejemplo n.º 14
0
 def test_prefix_only_mac(self):
     data = {'boot_interface': '01-aa-bb-cc-dd-ee-ff'}
     self.assertEqual('[node: MAC aa:bb:cc:dd:ee:ff]',
                      utils.processing_logger_prefix(data=data))
Ejemplo n.º 15
0
 def test_prefix_only_bmc(self):
     data = {'inventory': {'bmc_address': '1.2.3.4'}}
     self.assertEqual('[node: BMC 1.2.3.4]',
                      utils.processing_logger_prefix(data=data))