Revision 6a439d95 snf-cyclades-app/synnefo/logic/management/commands/subnet-list.py

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

Also available in: Unified diff