diff options
author | root <root@krebs> | 2011-08-22 23:27:58 +0200 |
---|---|---|
committer | root <root@krebs> | 2011-08-22 23:27:58 +0200 |
commit | ccbb59070dfbec560c989cb8c6bd2baf7a8e047e (patch) | |
tree | 2bcd4b69c45aead9265fa1f55e060e6662f8819c /ovh/soapi/domainList | |
parent | 77653ab3cb741537e475c2556b6c164b74657e99 (diff) | |
parent | b249a8963df0869c3f7509b99d15ab4e08954b07 (diff) |
Merge branch 'master' of github.com:/krebscode/painload
Diffstat (limited to 'ovh/soapi/domainList')
-rwxr-xr-x | ovh/soapi/domainList | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/ovh/soapi/domainList b/ovh/soapi/domainList index 3f829ebe..342eec72 100755 --- a/ovh/soapi/domainList +++ b/ovh/soapi/domainList @@ -1,24 +1,28 @@ #!/usr/bin/python from os import environ -import pprint +from os.path import dirname, realpath from SOAPpy import WSDL +from json import dumps, JSONEncoder -soap = WSDL.Proxy('https://www.ovh.com/soapi/soapi-re-1.24.wsdl') +def default(o): + try: + iterable = iter(o) + except TypeError: + pass + else: + return list(iterable) + return JSONEncoder.default(o) + +wsdl = dirname(realpath(__file__)) + '/soapi-re-1.24.wsdl' +soap = WSDL.Proxy(wsdl) username = environ['KREBS_OVH_USER'] password = environ['KREBS_OVH_PASS'] -#login session = soap.login(username, password, 'de', 0) -print "login successfull" -#domainHostList result = soap.domainList(session) -print "domainList 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) -print "logout successfull" |