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 | c0788cf40e57f8ef0f12821239373914e243f879 (patch) | |
tree | 1d77d7c973009e6f741c17d29f9eb2cd3acb70b3 /ovh | |
parent | 7c72e088904ee47d3b10e86770e11b41d5fe70e0 (diff) |
ovh soapi zoneEntryList: initial commit
Diffstat (limited to 'ovh')
-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) |