gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [ascension] branch master updated: added --dry-run option,


From: gnunet
Subject: [GNUnet-SVN] [ascension] branch master updated: added --dry-run option, bumped version, updated docs
Date: Thu, 09 May 2019 21:57:48 +0200

This is an automated email from the git hooks/post-receive script.

rexxnor pushed a commit to branch master
in repository ascension.

The following commit(s) were added to refs/heads/master by this push:
     new 7e1e8df  added --dry-run option, bumped version, updated docs
7e1e8df is described below

commit 7e1e8df9145a8524bba10030683e9844dd71b1bc
Author: rexxnor <address@hidden>
AuthorDate: Thu May 9 21:55:25 2019 +0200

    added --dry-run option, bumped version, updated docs
---
 README                 |  8 +++++---
 ascension.1            | 10 +++++-----
 ascension/ascension.py | 19 ++++++++++++++-----
 setup.py               |  2 +-
 4 files changed, 25 insertions(+), 14 deletions(-)

diff --git a/README b/README
index 28e3e1f..d201db0 100644
--- a/README
+++ b/README
@@ -38,11 +38,12 @@ Taken from the docstring of the ascension.py file:
 Ascension
 
 Usage:
-    ascension <domain> [-d] [-p] [-s] [--minimum-ttl=<ttl>]
+    ascension <domain> [-d] [-p] [-s] [--minimum-ttl=<ttl>] [--dry-run]
     ascension <domain> <port> [-d] [-p] [-s] [--minimum-ttl=<ttl>]
-    ascension <domain> -n <transferns> [-d] [-p] [-s] [--minimum-ttl=<ttl>]
-    ascension <domain> -n <transferns> <port> [-d] [-p] [-s] 
[--minimum-ttl=<ttl>]
+    ascension <domain> -n <transferns> [-d] [-p] [-s] [--minimum-ttl=<ttl>] 
[--dry-run]
+    ascension <domain> -n <transferns> <port> [-d] [-p] [-s] 
[--minimum-ttl=<ttl>] [--dry-run]
     ascension -p | --public
+    ascension -s | --debug
     ascension -s | --standalone
     ascension -h | --help
     ascension -v | --version
@@ -52,6 +53,7 @@ Options:
     <port>                Port for zone transfer
     <transferns>          DNS Server that does the zone transfer
     --minimum-ttl=<ttl>   Minimum TTL for records to migrate [default: 3600]
+    --dry-run             Only try if a zone transfer is allowed
     -p --public           Make records public on the DHT
     -s --standalone       Run ascension once
     -d --debug            Enable debugging
diff --git a/ascension.1 b/ascension.1
index 1a18d10..93810c6 100644
--- a/ascension.1
+++ b/ascension.1
@@ -21,7 +21,7 @@
 .\"
 .\" SPDX-License-Identifier: GPL3.0-or-later OR FDL1.3-or-later
 .\"
-.Dd May 1, 2019
+.Dd May 9, 2019
 .Dt ASCENSION 1
 .Os
 .Sh NAME
@@ -29,10 +29,10 @@
 .Nd migrate existing DNS zones into the GNU Name System
 .Sh SYNOPSIS
 .Nm
-.Op Ar domain Fl d Fl p Fl s Fl minimum-ttl=<ttl>
-.Op Ar domain port Fl d Fl p Fl s Fl minimum-ttl=<ttl>
-.Op Ar domain Fl n Ar transferns Fl d Fl p Fl s Fl minimum-ttl=<ttl>
-.Op Ar domain Fl n Ar transferns Ar port Fl d Fl p Fl s Fl minimum-ttl=<ttl>
+.Op Ar domain Fl d Fl p Fl s \- minimum-ttl=<ttl> \- dry-run
+.Op Ar domain port Fl d Fl p Fl s \- minimum-ttl=<ttl> \- dry-run
+.Op Ar domain Fl n Ar transferns Fl d Fl p Fl s Fl \- minimum-ttl=<ttl> \- 
dry-run
+.Op Ar domain Fl n Ar transferns Ar port Fl d Fl p Fl s \- minimum-ttl=<ttl> 
\- dry-run
 .Op Fl d | \-debug
 .Op Fl h | \-help
 .Op Fl p | \-public
diff --git a/ascension/ascension.py b/ascension/ascension.py
index e3eac92..790306a 100644
--- a/ascension/ascension.py
+++ b/ascension/ascension.py
@@ -20,11 +20,12 @@
 # Author rexxnor
 """
 Usage:
-    ascension <domain> [-d] [-p] [-s] [--minimum-ttl=<ttl>]
+    ascension <domain> [-d] [-p] [-s] [--minimum-ttl=<ttl>] [--dry-run]
     ascension <domain> <port> [-d] [-p] [-s] [--minimum-ttl=<ttl>]
-    ascension <domain> -n <transferns> [-d] [-p] [-s] [--minimum-ttl=<ttl>]
-    ascension <domain> -n <transferns> <port> [-d] [-p] [-s] 
[--minimum-ttl=<ttl>]
+    ascension <domain> -n <transferns> [-d] [-p] [-s] [--minimum-ttl=<ttl>] 
[--dry-run]
+    ascension <domain> -n <transferns> <port> [-d] [-p] [-s] 
[--minimum-ttl=<ttl>] [--dry-run]
     ascension -p | --public
+    ascension -s | --debug
     ascension -s | --standalone
     ascension -h | --help
     ascension -v | --version
@@ -34,6 +35,7 @@ Options:
     <port>                Port for zone transfer
     <transferns>          DNS Server that does the zone transfer
     --minimum-ttl=<ttl>   Minimum TTL for records to migrate [default: 3600]
+    --dry-run             Only try if a zone transfer is allowed
     -p --public           Make records public on the DHT
     -s --standalone       Run ascension once
     -d --debug            Enable debugging
@@ -291,7 +293,7 @@ class Ascender():
             ttl = values.ttl
 
             gnspkeys = list(filter(lambda record: 
str(record).startswith('gns--pkey--')
-                                   and illegalchars not in str(record[11:]), 
values))
+                                   and illegalchars not in str(record)[11:], 
values))
 
             num_gnspkeys = len(gnspkeys)
             if not num_gnspkeys:
@@ -677,7 +679,7 @@ def main():
     Initializes object and handles arguments
     """
     # argument parsing from docstring definition
-    args = docopt.docopt(__doc__, version='Ascension 0.6.0')
+    args = docopt.docopt(__doc__, version='Ascension 0.6.1')
 
     # argument parsing
     debug = args['--debug']
@@ -686,6 +688,7 @@ def main():
     port = args['<port>'] if args['<port>'] else "53"
     flags = "p" if args.get('--public') else "n"
     standalone = bool(args.get('--standalone'))
+    dryrun = bool(args.get('--dry-run'))
     minimum = args['--minimum-ttl']
 
     # Change logging severity to debug
@@ -721,6 +724,12 @@ def main():
                                                    port=ascender.port)
         dns_zone_serial = ascender.get_dns_zone_serial(ascender.domain,
                                                        ascender.transferns)
+
+        if dryrun:
+            if dns_zone_serial:
+                return 0
+            return 1
+
         if not dns_zone_serial:
             logging.error("Could not get DNS zone serial")
             if standalone:
diff --git a/setup.py b/setup.py
index 94d6b14..7afc1b9 100644
--- a/setup.py
+++ b/setup.py
@@ -28,7 +28,7 @@ with open("README", "r") as fh:
 
 setuptools.setup(
     name="ascension",
-    version="0.6.0",
+    version="0.6.1",
     author="rexxnor",
     author_email="address@hidden",
     description="Tool to migrate DNS Zones to the GNU Name System",

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]