Revision 9115d567 snf-cyclades-app/synnefo/logic/management/commands/reconcile-networks.py

b/snf-cyclades-app/synnefo/logic/management/commands/reconcile-networks.py
109 109
        for bend in backends:
110 110
            bnet = get_backend_network(network, bend)
111 111
            gnet = ganeti_networks[bend].get(network.id)
112
            if not (bnet or gnet):
113
                # Network does not exist either in Ganeti nor in BD.
114
                continue
115
            if not bnet and gnet:
116
                # Network exists in Ganeti and not in DB.
117
                if network.action != "DESTROY" and not network.public:
118
                    reconcile_parted_network(network, bend)
112
            if not bnet:
113
                if network.floating_ip_pool:
114
                    # Network is a floating IP pool and does not exist in
115
                    # backend. We need to create it
116
                    bnet = reconcile_parted_network(network, bend)
117
                elif not gnet:
118
                    # Network does not exist either in Ganeti nor in BD.
119
                    continue
120
                else:
121
                    # Network exists in Ganeti and not in DB.
122
                    if network.action != "DESTROY" and not network.public:
123
                        bnet = reconcile_parted_network(network, bend)
119 124

  
120 125
            if not gnet:
121 126
                # Network does not exist in Ganeti. If the network action is

Also available in: Unified diff