Revision 1cea389e api/handlers.py

b/api/handlers.py
95 95

  
96 96
    @paginator
97 97
    def read_all(self, request, detail=False):
98
        virtual_servers = VirtualMachine.objects.all()
99
        virtual_servers = [virtual_server for virtual_server in  virtual_servers if virtual_server.rsapi_state !="DELETED"]
98
        virtual_servers = VirtualMachine.objects.filter(deleted=False) 
100 99
        #get all VM's for now, FIX it to take the user's VMs only yet. also don't get deleted VM's
101 100

  
102 101
        if not detail:
......
109 108
                                     'imageId': server.sourceimage.id, 
110 109
                                     'hostId': server.hostid, 
111 110
                                     #'metadata': {'Server_Label': server.description },
112
                                     'metadata':[{'meta': { 'key': {metadata.meta_key: metadata.meta_value}}} for metadata in server.virtualmachinemetadata_set.all()],                                     
113
                                     'addresses': {'ip_four': { 'ip': {'addr': server.ipfour}},'ip_six': { 'ip': {'addr': server.ipsix}}},            
111
                                     'metadata':[{'meta': { 'key': {metadata.meta_key: metadata.meta_value}}} for metadata in server.virtualmachinemetadata_set.all()],                                    
112
                                     'addresses': {'public': { 'ip': {'addr': server.ipfour}, 'ip6': {'addr': server.ipsix}},'private': ''},      
113

  
114 114
                                    } for server in virtual_servers]
115 115
            #pass some fake data regarding ip, since we don't have any such data            
116 116
            return { "servers":  virtual_servers_list }                

Also available in: Unified diff