Revision 6b5cdb0f snf-cyclades-app/synnefo/logic/management/commands/backend-add.py

b/snf-cyclades-app/synnefo/logic/management/commands/backend-add.py
122 122
        backend_mod.update_backend_resources(backend, resources)
123 123
        backend_mod.update_backend_disk_templates(backend)
124 124

  
125
        networks = Network.objects.filter(deleted=False, floating_ip_pool=True)
125
        networks = Network.objects.filter(deleted=False, public=True)
126 126
        if not networks:
127 127
            return
128 128

  
129
        stream.write("Creating the follow networks:\n")
130
        headers = ('Name', 'Subnet', 'Gateway', 'Mac Prefix', 'Public')
129
        stream.write("Creating the following public:\n")
130
        headers = ("ID", "Name", 'IPv4 Subnet', "IPv6 Subnet", 'Mac Prefix')
131 131
        table = []
132 132

  
133 133
        for net in networks:
134
            table.append((net.backend_id, str(net.subnet), str(net.gateway),
135
                         str(net.mac_prefix), str(net.public)))
134
            subnet4 = net.subnet4.cidr if net.subnet4 else None
135
            subnet6 = net.subnet6.cidr if net.subnet6 else None
136
            table.append((net.id, net.backend_id, subnet4,
137
                          subnet6, str(net.mac_prefix)))
136 138
        pprint_table(stream, table, headers)
137 139

  
138 140
        for net in networks:

Also available in: Unified diff