From cf21ec33a930a22a319cd8a83a3907710e561d68 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 12 May 2019 12:22:14 +0200 Subject: [PATCH 1/2] 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: From 25e57e89ab6703aa011da4598e22f130c2695e45 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 12 May 2019 12:31:51 +0200 Subject: [PATCH 2/2] update readme --- README.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index bbe61d6..36a30cb 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,15 @@ -# Ungleich dns cli tool +# ungleich cli -A python package to set reverse dns in ungleich vm. +This CLI is used for day-to-day tasks used at ungleich. +It is intended to be used by ungleich engineers and skilled customers. -## Requirements +## Requirements / Installation -You need at least python 3. +* ensure you have python3 +* git clone this repo +* python ungleich-cli.py -## Usage +## Usage: DNS installing the package via pip (python3 required)