diff options
author | tv <tv@xso> | 2011-08-22 15:20:28 +0200 |
---|---|---|
committer | tv <tv@xso> | 2011-08-22 15:20:28 +0200 |
commit | 1d241356396c4e7ec0fa957021108cf9144b1c89 (patch) | |
tree | 75d46b714a6900de14218b7fb7a7b10d60de0d41 /ovh/soapi | |
parent | 963b1ab3b05651afeec350e054a258595d067e26 (diff) |
ovh soapi zoneEntryList: initial commit
Diffstat (limited to 'ovh/soapi')
-rwxr-xr-x | ovh/soapi/zoneEntryList | 14 |
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) |