Revision 6a439d95

b/snf-cyclades-app/synnefo/logic/management/commands/subnet-list.py
64 64
            dest="dhcp",
65 65
            default=False,
66 66
            help="List only subnets that have DHCP/SLAC enabled"),
67
        make_option(
68
            "--public",
69
            action="store_true",
70
            dest="public",
71
            default=False,
72
            help="List only public subnets"),
67 73
    )
68 74

  
69 75
    object_class = Subnet
......
75 81
        "id": ("id", "ID of the subnet"),
76 82
        "network": ("network_id", "ID of the network the subnet belongs to"),
77 83
        "name": ("name", "Name of the subnet"),
78
        "user.uuid": ("network.userid", "The UUID of the subnet's owner"),
84
        "user.uuid": ("userid", "The UUID of the subnet's owner"),
79 85
        "cidr": ("cidr", "The CIDR of the subnet"),
80 86
        "ipversion": ("ipversion", "The IP version of the subnet"),
81 87
        "gateway": ("gateway", "The gateway IP of the subnet"),
82 88
        "dhcp": ("dhcp", "DHCP flag of the subnet"),
89
        "public": ("public", "Public flag of the subnet"),
83 90
    }
84 91

  
85 92
    fields = ["id", "network", "name", "user.uuid", "cidr", "ipversion",
86
              "gateway", "dhcp"]
93
              "gateway", "dhcp", "public"]
87 94

  
88 95
    def handle_args(self, *args, **options):
89 96
        if options["ipv4"] and options["ipv6"]:
......
97 104

  
98 105
        if options["dhcp"]:
99 106
            self.filters["dhcp"] = True
107

  
108
        if options["public"]:
109
            self.filters["public"] = True
b/snf-cyclades-app/synnefo/management/pprint.py
135 135
    info = OrderedDict([("ID", subnet.id),
136 136
                        ("Network_ID", subnet.network.id),
137 137
                        # If a user names his subnet "-", what happens then?
138
                        ("User_ID", subnet.userid),
138 139
                        ("Name", "-" if subnet.name == "" else subnet.name),
139 140
                        ("IP_Version", subnet.ipversion),
140 141
                        ("CIDR", subnet.cidr),
141 142
                        ("Gateway", subnet.gateway),
143
                        ("Public", subnet.public),
142 144
                        ("DHCP/SLAAC", subnet.dhcp),
143 145
                        ("Host_Routes", subnet.host_routes),
144 146
                        ("DNS_Nameservers", subnet.dns_nameservers)])

Also available in: Unified diff