Revision a9c1db43 snf-cyclades-app/synnefo/management/pprint.py

b/snf-cyclades-app/synnefo/management/pprint.py
241 241
        vm_info = client.GetInstance(vm.backend_vm_id)
242 242
    except GanetiApiError as e:
243 243
        if e.code == 404:
244
            stdout.write("NIC seems attached to server %s, but"
244
            stdout.write("Port seems attached to server %s, but"
245 245
                         " server does not exist in backend.\n"
246 246
                         % vm)
247 247
            return
......
253 253
                         nics)[0]
254 254
        gnt_nic["instance"] = vm_info["name"]
255 255
    except IndexError:
256
        stdout.write("NIC %s is not attached to instance %s" % (port, vm))
256
        stdout.write("Port %s is not attached to instance %s" % (port, vm))
257 257
        return
258 258
    pprint_table(stdout, gnt_nic.items(), None, separator=" | ",
259 259
                 title=title)
......
302 302

  
303 303
def pprint_server_nics(server, stdout=None, title=None):
304 304
    if title is None:
305
        title = "NICs of Server %s" % server.id
305
        title = "Ports of Server %s" % server.id
306 306
    if stdout is None:
307 307
        stdout = sys.stdout
308 308

  
......
329 329
        server_info = client.GetInstance(server.backend_vm_id)
330 330
    except GanetiApiError as e:
331 331
        if e.code == 404:
332
            stdout.write("NIC seems attached to server %s, but"
333
                         " server does not exist in backend.\n"
334
                         % server)
332
            stdout.write("Server '%s' does not exist in backend '%s'\n"
333
                         % (server.id, server.backend.clustername))
335 334
            return
336 335
        raise e
337 336
    server.put_client(client)
......
344 343
                              for k in GANETI_INSTANCE_FIELDS])
345 344

  
346 345
    pprint_table(stdout, server_dict.items(), None, separator=" | ",
347
                 title="NICs of Server %s in Ganeti" % server.id)
346
                 title=title)
348 347
    stdout.write("\n")
349 348

  
350 349
    nics = nics_from_instance(server_info)
351 350
    nics_keys = ["ip", "mac", "name", "network"]
352 351
    nics_values = [[nic[key] for key in nics_keys] for nic in nics]
353 352
    pprint_table(stdout, nics_values, nics_keys, separator=" | ",
354
                 title=title)
353
                 title="NICs of Server %s in Ganeti" % server.id)
355 354

  
356 355
    if not print_jobs:
357 356
        return

Also available in: Unified diff