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/zoneImport | |
parent | 77653ab3cb741537e475c2556b6c164b74657e99 (diff) | |
parent | b249a8963df0869c3f7509b99d15ab4e08954b07 (diff) |
Merge branch 'master' of github.com:/krebscode/painload
Diffstat (limited to 'ovh/soapi/zoneImport')
-rwxr-xr-x | ovh/soapi/zoneImport | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/ovh/soapi/zoneImport b/ovh/soapi/zoneImport new file mode 100755 index 00000000..141fb4a2 --- /dev/null +++ b/ovh/soapi/zoneImport @@ -0,0 +1,32 @@ +#!/usr/bin/python + +from os import environ +from os.path import dirname, realpath +from SOAPpy import WSDL +from sys import argv, stdin +from string import join +from json import dumps, JSONEncoder + +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'] + +zone = join(stdin.readlines(),'') + +session = soap.login(username, password, 'en', 0) + +result = soap.zoneImport(session, 'krebsco.de', zone) +print result + +soap.logout(session) |