def _delete(self, cluster_id): display_result(self.get(cluster_id), ClusterDetail) if not confirm('Delete this cluster?'): return self.delete(cluster_id)
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)
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)
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()
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)
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)
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')
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)
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')
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')
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')
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')
def display(self): display_result(self, DistroDetail, title='Distro') six.print_() display_result(self.services, DistroService, 'Services')