Ejemplo n.º 1
0
 def test_get_sum_disk_usage(self):
     stateOpers = StateOpers('d-mcl-mcluster-manager-test-n-3')
     result = stateOpers.get_sum_disk_usage()
     print "get_sum_disk_usage: %s" % result
     self.assertNotEqual(result, None, "result not none")
     self.assertNotEqual(result.get('root_mount'), 0, "root_mount > 0")
     self.assertNotEqual(result.get('volumes_mount'), 0,
                         "volumes_mount > 0")
Ejemplo n.º 2
0
 def gather(self):
     container_nodes = self.get_container_nodes()
     res_type = 'diskusage'
     for container_node in container_nodes:
         state_op = StateOpers(container_node.container_name)
         disk_usage = state_op.get_sum_disk_usage()
         node_name = self.con_op.get_container_node_from_container_name(
             container_node.cluster_name, container_node.container_name)
         disk_usage.update({
             'cluster_name': container_node.cluster_name,
             'node_name': node_name
         })
         self.write_to_es(res_type, disk_usage)