From cf21ec33a930a22a319cd8a83a3907710e561d68 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 12 May 2019 12:22:14 +0200 Subject: [PATCH] update Signed-off-by: Nico Schottelius --- README.md | 4 ++++ ungleich_ripe.py | 16 +++------------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index ac24e92..bbe61d6 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,10 @@ A python package to set reverse dns in ungleich vm. +## Requirements + +You need at least python 3. + ## Usage installing the package via pip (python3 required) diff --git a/ungleich_ripe.py b/ungleich_ripe.py index 51fe966..2d3fce4 100644 --- a/ungleich_ripe.py +++ b/ungleich_ripe.py @@ -41,19 +41,9 @@ class ungleichRIPE(object): ripe_object['descr'] = args.description ripe_object['mnt-by'] = "mnt-ungleich" -# ripe_attributes = [] ripe_attributes = [{ "name": key, "value": value } for key, value in ripe_object.items() ] - # for key, value in ripe_object.items(): - # ripe_attributes.append( { "name": key, - # "value": value - # } - # ) - - # "source": { - # "id": "RIPE" - # }, - + # Format according to API layout ripe_element = {} ripe_element['objects'] = [] ripe_element['objects'].append( @@ -69,6 +59,8 @@ class ungleichRIPE(object): ) data = json.dumps(ripe_element).encode('utf-8') + + # debug pprint.pprint(ripe_element) method = 'POST' @@ -81,8 +73,6 @@ class ungleichRIPE(object): "Accept": "application/json" }) - pprint.pprint(req) - print("Adding a v6 route object at {} for {} with {} req={}".format(url, args.network, data, str(req))) with urllib.request.urlopen(req) as f: