def _list(self, opts):
    (groups, errors) = self.rest.get_server_groups()
    _exit_if_errors(errors)
    found = False
    for group in groups['groups']:
        if ((opts.name is None) or (opts.name == group['name'])):
            found = True
            print(group['name'])
            for node in group['nodes']:
                print(f" server: {node['hostname']}")
    if ((not found) and opts.name):
        _exit_if_errors([f'Invalid group name: {opts.name}'])
def _list(self, opts):
    (groups, errors) = self.rest.get_server_groups()
    _exit_if_errors(errors)
    found = False
    for group in groups['groups']:
        if ((opts.name is None) or (opts.name == group['name'])):
            found = True
            print(group['name'])
            for node in group['nodes']:
                print(f" server: {node['hostname']}")
    if ((not found) and opts.name):
        _exit_if_errors([f'Invalid group name: {opts.name}'])