Beispiel #1
0
    def _determine_height_for_resource_node(self, elem_cp, node_type, elem_rn):
        LOG.info('%s(elem_cp="%s", node_type="%s", elem_rn="%s")' % (
            KenLog.fcn(),
            ControlPlane.get_name(elem_cp),
            node_type,
            ResourceNode.get_hostname(elem_rn)))

        num_rn_allocations = 0
        allocations = self._get_resource_node_allocations(elem_cp, node_type)
        LOG.info('-------------------------------------')
        for k, v in six.iteritems(allocations):
            LOG.info(v)
            if 'start' in v and 'end' in v:
                num_rn_allocations += 1
        LOG.info('------------------------------------- %d' %
                 num_rn_allocations)

        height = self._padding_y
        height += len(ResourceNode.get_services(elem_rn))
        height += 1  # Dashes
        height += num_rn_allocations
        height += self._padding_y

        return height