BBlack has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/174274

Change subject: Update authdns scripts for gdnsd 2.x only
......................................................................

Update authdns scripts for gdnsd 2.x only

Change-Id: I8c0b16ae6ec069acfb950eac8f2e060b75aae675
---
M modules/authdns/files/authdns-lint
M modules/authdns/files/authdns-local-update
2 files changed, 10 insertions(+), 28 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/74/174274/1

diff --git a/modules/authdns/files/authdns-lint 
b/modules/authdns/files/authdns-lint
index c9a76f3..b2e08a4 100644
--- a/modules/authdns/files/authdns-lint
+++ b/modules/authdns/files/authdns-lint
@@ -22,6 +22,9 @@
 WORKINGDIR=$1
 TESTDIR=$2
 
+# 1.x and 2.x have different path-related flags...
+(gdnsd -h 2>&1 | grep -q 'gdnsd version 2') || die "This script only supports 
gdnsd 2.x"
+
 if [ -z "$WORKINGDIR" ]; then
     die "no template dir specified"
 fi
@@ -57,11 +60,4 @@
     echo "  $file"
 done
 
-# 1.x and 2.x have different path-related flags...
-v2=1
-(gdnsd -h 2>&1 | grep -q 'gdnsd version 2') || v2=0
-if [ $v2 -eq 1 ]; then
-    gdnsd -sSc $TESTDIR/etc checkconf
-else
-    gdnsd -sSd $TESTDIR checkconf
-fi
+gdnsd -sSc $TESTDIR/etc checkconf
diff --git a/modules/authdns/files/authdns-local-update 
b/modules/authdns/files/authdns-local-update
index 4a2ec8e..ad1ccdc 100644
--- a/modules/authdns/files/authdns-local-update
+++ b/modules/authdns/files/authdns-local-update
@@ -21,8 +21,7 @@
 fi
 
 # 1.x and 2.x have differences
-GDNSD_V2=1
-(gdnsd -h 2>&1 | grep -q 'gdnsd version 2') || GDNSD_V2=0
+(gdnsd -h 2>&1 | grep -q 'gdnsd version 2') || die "This script only supports 
gdnsd 2.x"
 
 # setup locking; only one copy of this may be running at the same time
 LOCKFILE=/var/lock/authdns-local-update
@@ -98,20 +97,11 @@
     exit 0
 fi
 
-if [ $GDNSD_V2 -eq 1 ]; then
-    if ! gdnsd checkconf >/dev/null; then
-        if [ -f /etc/gdnsd/config~ ]; then
-            mv /etc/gdnsd/config~ /etc/gdnsd/config
-        fi
-        die "gdnsd checkconf failed, aborting"
+if ! gdnsd checkconf >/dev/null; then
+    if [ -f /etc/gdnsd/config~ ]; then
+        mv /etc/gdnsd/config~ /etc/gdnsd/config
     fi
-else
-    if ! gdnsd checkconf 2>/dev/null; then
-        if [ -f /etc/gdnsd/config~ ]; then
-            mv /etc/gdnsd/config~ /etc/gdnsd/config
-        fi
-        die "gdnsd checkconf failed, aborting"
-    fi
+    die "gdnsd checkconf failed, aborting"
 fi
 
 ### reload
@@ -123,9 +113,5 @@
 else
     rm -f /etc/gdnsd/config~
     echo "Reloading zones"
-    if [ $GDNSD_V2 -eq 1 ]; then
-        gdnsd reload-zones
-    else
-        gdnsd reload
-    fi
+    gdnsd reload-zones
 fi

-- 
To view, visit https://gerrit.wikimedia.org/r/174274
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8c0b16ae6ec069acfb950eac8f2e060b75aae675
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BBlack <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to