summaryrefslogtreecommitdiffstats
path: root/ovh
diff options
context:
space:
mode:
Diffstat (limited to 'ovh')
-rwxr-xr-xovh/soapi/zoneEntryList14
1 files changed, 11 insertions, 3 deletions
diff --git a/ovh/soapi/zoneEntryList b/ovh/soapi/zoneEntryList
index 7c032462..eb9c9c09 100755
--- a/ovh/soapi/zoneEntryList
+++ b/ovh/soapi/zoneEntryList
@@ -1,8 +1,17 @@
#!/usr/bin/python
from os import environ
-import pprint
from SOAPpy import WSDL
+from json import dumps, JSONEncoder
+
+def default(o):
+ try:
+ iterable = iter(o)
+ except TypeError:
+ pass
+ else:
+ return list(iterable)
+ return JSONEncoder.default(o)
soap = WSDL.Proxy('https://www.ovh.com/soapi/soapi-re-1.24.wsdl')
@@ -16,8 +25,7 @@ print "login successfull"
#zoneEntryList
result = soap.zoneEntryList(session, 'krebsco.de')
print "zoneEntryList successfull"
-pp = pprint.PrettyPrinter(indent=4)
-pp.pprint(result) # your code here ...
+print dumps(result, sort_keys=True, indent=2, default=default)
#logout
soap.logout(session)