Revision db908bb1

b/snf-cyclades-app/synnefo/api/management/commands/server-create.py
69 69
                         " available flavors."),
70 70
        make_option("--password", dest="password",
71 71
                    help="Password for the new server"),
72
        make_option("--networks", dest="network_ids",
73
                    help="Comma separated list of network IDs to connect"),
74
        make_option("--ports", dest="port_ids",
75
                    help="Comma separated list of port IDs to connect"),
76
        make_option("--floating-ips", dest="floating_ip_ids",
77
                    help="Comma separated list of port IDs to connect"),
72 78
        make_option(
73 79
            '--wait',
74 80
            dest='wait',
75
            default="True",
81
            default="False",
76 82
            choices=["True", "False"],
77 83
            metavar="True|False",
78 84
            help="Wait for Ganeti job to complete."),
......
109 115
        else:
110 116
            backend = None
111 117

  
118
        network_ids = parse_list(options["network_ids"])
119
        port_ids = parse_list(options["port_ids"])
120
        floating_ip_ids = parse_list(options["floating_ip_ids"])
121

  
122
        networks = map(lambda x: {"uuid": x}, network_ids)
123
        ports = map(lambda x: {"port": x}, port_ids)
124

  
112 125
        server = servers.create(user_id, name, password, flavor, image,
126
                                networks=(ports+networks),
127
                                floating_ips=floating_ip_ids,
113 128
                                use_backend=backend)
114 129
        pprint.pprint_server(server, stdout=self.stdout)
115 130

  
116 131
        wait = parse_bool(options["wait"])
117 132
        common.wait_server_task(server, wait, self.stdout)
133

  
134

  
135
def parse_list(_list):
136
    if _list is None:
137
        return []
138
    else:
139
        return _list.split(",")
b/snf-cyclades-app/synnefo/management/pprint.py
264 264

  
265 265
    nics = []
266 266
    for nic in server.nics.all():
267
        nics.append((nic.name, nic.index, nic.mac, nic.ipv4_address,
267
        nics.append((nic.id, nic.name, nic.index, nic.mac, nic.ipv4_address,
268 268
                     nic.ipv6_address, nic.network, nic.firewall_profile,
269 269
                     nic.state))
270 270

  
271
    headers = ["Name", "Index", "MAC", "IPv4 Address", "IPv6 Address",
271
    headers = ["ID", "Name", "Index", "MAC", "IPv4 Address", "IPv6 Address",
272 272
               "Network", "Firewall", "State"]
273 273
    pprint_table(stdout, nics, headers, separator=" | ",
274 274
                 title=title)

Also available in: Unified diff