Revision c9e99213 snf-cyclades-app/synnefo/logic/backend_allocator.py

b/snf-cyclades-app/synnefo/logic/backend_allocator.py
71 71
        # Get available backends
72 72
        available_backends = get_available_backends(flavor)
73 73

  
74
        # Refresh backends, if needed
75
        refresh_backends_stats(available_backends)
76

  
77 74
        if not available_backends:
78 75
            return None
79 76

  
......
109 106

  
110 107
    backends = Backend.objects.select_for_update().filter(offline=False,
111 108
                                                          drained=False)
109
    # Update the disk_templates if there are empty.
110
    [backend_mod.update_backend_disk_templates(b)
111
     for b in backends if not b.disk_templates]
112 112
    backends = filter(lambda b: disk_template in b.disk_templates,
113 113
                      list(backends))
114

  
115
    # Update the backend stats if it is needed
116
    refresh_backends_stats(backends)
117

  
114 118
    return backends
115 119

  
116 120

  

Also available in: Unified diff