examples: fix print parenthesis place in get_ips.py
Fixes: 797d9c4403
('python: make dbus, gi examples, and debug-helper.py python3 ready')
This commit is contained in:

committed by
Íñigo Huguet

parent
63f2401ebe
commit
75350b3e76
@@ -35,7 +35,7 @@ def show_addresses(dev, family):
|
|||||||
addr = nm_address.get_address()
|
addr = nm_address.get_address()
|
||||||
prefix = nm_address.get_prefix()
|
prefix = nm_address.get_prefix()
|
||||||
|
|
||||||
print("%s/%d") % (addr, prefix)
|
print("%s/%d" % (addr, prefix))
|
||||||
|
|
||||||
|
|
||||||
def show_gateway(dev, family):
|
def show_gateway(dev, family):
|
||||||
@@ -75,7 +75,7 @@ def show_routes(dev, family):
|
|||||||
next_hop = nm_route.get_next_hop()
|
next_hop = nm_route.get_next_hop()
|
||||||
metric = nm_route.get_metric()
|
metric = nm_route.get_metric()
|
||||||
|
|
||||||
print("%s/%d %s %d") % (dest, prefix, next_hop, metric)
|
print("%s/%d %s %d" % (dest, prefix, next_hop, metric))
|
||||||
|
|
||||||
|
|
||||||
def show_dns(dev, family):
|
def show_dns(dev, family):
|
||||||
@@ -88,11 +88,11 @@ def show_dns(dev, family):
|
|||||||
print("None")
|
print("None")
|
||||||
return
|
return
|
||||||
|
|
||||||
print("Nameservers: %s") % (ip_cfg.get_nameservers())
|
print("Nameservers: %s" % ip_cfg.get_nameservers())
|
||||||
print("Domains: %s") % (ip_cfg.get_domains())
|
print("Domains: %s" % ip_cfg.get_domains())
|
||||||
print("Searches: %s") % (ip_cfg.get_searches())
|
print("Searches: %s" % ip_cfg.get_searches())
|
||||||
if family == socket.AF_INET:
|
if family == socket.AF_INET:
|
||||||
print("WINS: %s") % (ip_cfg.get_wins_servers())
|
print("WINS: %s" % ip_cfg.get_wins_servers())
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
@@ -110,39 +110,39 @@ if __name__ == "__main__":
|
|||||||
print("IPv4 addresses:")
|
print("IPv4 addresses:")
|
||||||
print("---------------")
|
print("---------------")
|
||||||
show_addresses(dev, socket.AF_INET)
|
show_addresses(dev, socket.AF_INET)
|
||||||
print
|
print()
|
||||||
|
|
||||||
print("IPv4 gateway:")
|
print("IPv4 gateway:")
|
||||||
print("-------------")
|
print("-------------")
|
||||||
show_gateway(dev, socket.AF_INET)
|
show_gateway(dev, socket.AF_INET)
|
||||||
print
|
print()
|
||||||
|
|
||||||
print("IPv4 routes:")
|
print("IPv4 routes:")
|
||||||
print("------------")
|
print("------------")
|
||||||
show_routes(dev, socket.AF_INET)
|
show_routes(dev, socket.AF_INET)
|
||||||
print
|
print()
|
||||||
|
|
||||||
print("IPv6 addresses:")
|
print("IPv6 addresses:")
|
||||||
print("---------------")
|
print("---------------")
|
||||||
show_addresses(dev, socket.AF_INET6)
|
show_addresses(dev, socket.AF_INET6)
|
||||||
print
|
print()
|
||||||
|
|
||||||
print("IPv6 gateway:")
|
print("IPv6 gateway:")
|
||||||
print("-------------")
|
print("-------------")
|
||||||
show_gateway(dev, socket.AF_INET6)
|
show_gateway(dev, socket.AF_INET6)
|
||||||
print
|
print()
|
||||||
|
|
||||||
print("IPv6 routes:")
|
print("IPv6 routes:")
|
||||||
print("------------")
|
print("------------")
|
||||||
show_routes(dev, socket.AF_INET6)
|
show_routes(dev, socket.AF_INET6)
|
||||||
print
|
print()
|
||||||
|
|
||||||
print("IPv4 DNS:")
|
print("IPv4 DNS:")
|
||||||
print("------------")
|
print("------------")
|
||||||
show_dns(dev, socket.AF_INET)
|
show_dns(dev, socket.AF_INET)
|
||||||
print
|
print()
|
||||||
|
|
||||||
print("IPv6 DNS:")
|
print("IPv6 DNS:")
|
||||||
print("------------")
|
print("------------")
|
||||||
show_dns(dev, socket.AF_INET6)
|
show_dns(dev, socket.AF_INET6)
|
||||||
print
|
print()
|
||||||
|
Reference in New Issue
Block a user