From 43a8f83f5614ab0d9da3d1da54e00f3079ef8951 Mon Sep 17 00:00:00 2001 From: Piotr Dobrowolski Date: Fri, 10 Mar 2017 18:16:40 +0100 Subject: [PATCH] Fix list subcommand failing on empty domain --- ovhtool.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ovhtool.py b/ovhtool.py index 0eb112d..f70700b 100644 --- a/ovhtool.py +++ b/ovhtool.py @@ -73,7 +73,8 @@ if __name__ == "__main__": if args[''] == 'list': ips = list_ips() for _, ip in ips.items(): - print '%15s | %17s | %s' % (ip.ip, ip.mac, ip.domain) + hostname = ip.domain.name() if ip.domain else '' + print '%15s | %17s | %s' % (ip.ip, ip.mac, hostname) elif args[''] == 'sync': client = ovh.Client() server = client.get('/dedicated/server')[0]