dao/client/shell.py
def server_list(self, args):
        """List servers, using provided filters."""
        servers = self._call('servers_list',
                             rack_name=args.rack,
                             cluster_name=args.cluster,
                             serials=args.serial,
                             macs=args.mac,
                             ips=args.ip,
                             names=args.name,
                             from_status=args.status,
                             sku_name=args.sku,
                             detailed=args.detailed)
        # way to fix unicode
        if isinstance(servers, dict):
            servers = json.loads(json.dumps(servers))
        for s in servers.values():
            interfaces = s.pop('interfaces', [])
            if interfaces:
                for iface in interfaces:
                    # for backward comp-ty there are more code then is required
                    if args.filter:
                        name = iface['name'].lower().replace(' ', '')
                    else:
                        name = 'interface:%s' % iface['name']
                        if args.format == 'print':
                            iface = str(iface)
                    s[name] = iface
        self._print_result(args, servers)
List servers, using provided filters.
List servers, using provided filters.
List servers using provided filters .
def server_list(self, args):
        servers = self._call('servers_list',
                             rack_name=args.rack,
                             cluster_name=args.cluster,
                             serials=args.serial,
                             macs=args.mac,
                             ips=args.ip,
                             names=args.name,
                             from_status=args.status,
                             sku_name=args.sku,
                             detailed=args.detailed)
        if isinstance(servers, dict):
            servers = json.loads(json.dumps(servers))
        for s in servers.values():
            interfaces = s.pop('interfaces', [])
            if interfaces:
                for iface in interfaces:
                    if args.filter:
                        name = iface['name'].lower().replace(' ', '')
                    else:
                        name = 'interface:%s' % iface['name']
                        if args.format == 'print':
                            iface = str(iface)
                    s[name] = iface
        self._print_result(args, servers)
def server_list ( self , args ) : servers = self . _call ( 'servers_list' , rack_name = args . rack , cluster_name = args . cluster , serials = args . serial , macs = args . mac , ips = args . ip , names = args . name , from_status = args . status , sku_name = args . sku , detailed = args . detailed ) if isinstance ( servers , dict ) : servers = json . loads ( json . dumps ( servers ) ) for s in servers . values ( ) : interfaces = s . pop ( 'interfaces' , [ ] ) if interfaces : for iface in interfaces : if args . filter : name = iface [ 'name' ] . lower ( ) . replace ( ' ' , '' ) else : name = 'interface:%s' % iface [ 'name' ] if args . format == 'print' : iface = str ( iface ) s [ name ] = iface self . _print_result ( args , servers )
List servers, using provided filters.
List servers using provided filters .
"""List servers, using provided filters.""" # way to fix unicode # for backward comp-ty there are more code then is required
self
args