Exemplo n.º 1
0
    def _delete(self, cluster_id):
        display_result(self.get(cluster_id), ClusterDetail)

        if not confirm('Delete this cluster?'):
            return

        self.delete(cluster_id)
Exemplo n.º 2
0
    def _delete(self, cluster_id, force=False):
        if not force:
            display_result(self.get(cluster_id), ClusterDetail)

            if not confirm('Delete this cluster?'):
                return

        self.delete(cluster_id)
Exemplo n.º 3
0
    def _delete(self, stack_id, force=False):
        if not force:
            display_result(self.get(stack_id), StackDetail)

            if not confirm('Delete this stack?'):
                return

        self.delete(stack_id)
Exemplo n.º 4
0
    def display(self):
        display_result(self, StackDetail, title='Stack')

        if self.node_groups:
            display_result(self.node_groups, StackNodeGroup,
                           title='Node Groups')

            self._display_components()
Exemplo n.º 5
0
    def _delete(self, stack_id, force=False):
        if not force:
            display_result(self.get(stack_id), StackDetail)

            if not confirm('Delete this stack?'):
                return

        self.delete(stack_id)
Exemplo n.º 6
0
    def _delete(self, stack_ids, force=False):
        for stack_id in stack_ids:
            if not force:
                display_result(self.get(stack_id), StackDetail)

                if not confirm('Delete this stack?'):
                    continue

            self.delete(stack_id)
Exemplo n.º 7
0
    def _delete(self, cluster_ids, force=False):
        for cluster_id in cluster_ids:
            if not force:
                display_result(self.get(cluster_id), ClusterDetail)

                if not confirm('Delete this cluster?'):
                    continue

            self.delete(cluster_id)
Exemplo n.º 8
0
    def display(self):
        display_result(self, StackDetail, title='Stack')

        if self.node_groups:
            display_result(self.node_groups,
                           StackNodeGroup,
                           title='Node Groups')

            self._display_components()
Exemplo n.º 9
0
    def display(self):
        display_result(self, ClusterDetail, title='Cluster')
        six.print_()
        self.credentials.display()

        if self.node_groups:
            six.print_()
            self.display_node_groups()

        if self.scripts:
            six.print_()
            display_result(self.scripts, NodeScript, title='Scripts')
Exemplo n.º 10
0
    def _delete(self, cluster_ids, force=False):
        for cluster_id in cluster_ids:
            if not force:
                cluster = self._get_by_name_or_id(cluster_id)
                cluster_id = cluster.id

                display_result(cluster, ClusterDetail)

                if not confirm('Delete this cluster?'):
                    continue

            self.delete(cluster_id)
Exemplo n.º 11
0
    def display(self):
        display_result(self, ClusterDetail, title='Cluster')
        six.print_()
        self.credentials.display()

        if self.node_groups:
            six.print_()
            self.display_node_groups()

        if self.scripts:
            six.print_()
            display_result(self.scripts, ClusterScript, title='Scripts')
Exemplo n.º 12
0
    def display_nodes(cls, nodes):
        display_result(nodes, Node, title='Nodes')

        rows = []
        for node in nodes:
            node_column = chain([node.name], repeat(''))

            rows.extend(
                no_nulls([name, comp['name'], comp['nice_name'],
                          comp.get('uri')])
                for name, comp in six.moves.zip(node_column, node.components))

        print_table(rows, ('Node', 'ID', 'Name', 'URI'), title='Components')
Exemplo n.º 13
0
    def display_nodes(cls, nodes):
        sorted_nodes = sorted(nodes, key=lambda node: node.name)
        display_result(sorted_nodes, Node, title='Nodes')

        six.print_()
        rows = []
        for node in sorted_nodes:
            node_column = chain([node.name], repeat(''))

            rows.extend(
                no_nulls(
                    [name, comp['name'], comp['nice_name'],
                     comp.get('uri')])
                for name, comp in six.moves.zip(node_column, node.components))

        print_table(rows, ('Node', 'ID', 'Name', 'URI'), title='Components')
Exemplo n.º 14
0
    def display(self):
        display_result(self, ClusterDetail, title='Cluster')

        if self.node_groups:
            six.print_()
            display_result(self.node_groups, NodeGroup, title='Node Groups')

        if self.scripts:
            six.print_()
            display_result(self.scripts, ClusterScript, title='Scripts')
Exemplo n.º 15
0
 def display(self):
     display_result(self, DistroDetail, title='Distro')
     six.print_()
     display_result(self.services, DistroService, 'Services')
Exemplo n.º 16
0
 def display(self):
     display_result(self, DistroDetail, title='Distro')
     six.print_()
     display_result(self.services, DistroService, 'Services')