Dzahn has uploaded a new change for review.
https://gerrit.wikimedia.org/r/319483
Change subject: mgmt: fix-up grep regex in getmgmtips
......................................................................
mgmt: fix-up grep regex in getmgmtips
Change the grep regex to include names with a "-"
dash character in them.
Always delete the tmp files on startup.
Change-Id: Ib4a710e17163f9318d2f367aeb2d762d3a634d85
---
M modules/mgmt/files/getmgmtips
1 file changed, 7 insertions(+), 10 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/puppet
refs/changes/83/319483/1
diff --git a/modules/mgmt/files/getmgmtips b/modules/mgmt/files/getmgmtips
index 1cbc685..4ff9c72 100644
--- a/modules/mgmt/files/getmgmtips
+++ b/modules/mgmt/files/getmgmtips
@@ -14,15 +14,11 @@
echo "getting all mgmt hostnames from DNS templates.."
-if [ ! -d "$tempdir" ]; then
- echo "creating temp dir $tempdir and git cloning DNS repo.."
- mkdir -p $tempdir
- cd $tempdir
- git clone $dnsrepo
-else
- echo "removing $tempdir"
- rm -rf $tempdir
-fi
+rm -rf $tempdir
+echo "creating temp dir $tempdir and git cloning DNS repo.."
+mkdir -p $tempdir
+cd $tempdir
+git clone $dnsrepo
cd ${tempdir}/dns/templates
@@ -32,7 +28,8 @@
fi
echo -e "extracting mgmt hostnames from 10.in-addr.arpa..\n"
-mgmt_hosts=$(grep -oh "\w*.mgmt.\w*.\w*.\w*" 10.in-addr.arpa)
+# mgmt_hosts=$(grep -oh "\w*.mgmt.\w*.\w*.\w*" 10.in-addr.arpa)
+mgmt_hosts=$(grep -o '[a-z].*\.mgmt\.[a-z].*' 10.in-addr.arpa)
touch $resulfile.tmp
touch $rejectfile.tmp
--
To view, visit https://gerrit.wikimedia.org/r/319483
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib4a710e17163f9318d2f367aeb2d762d3a634d85
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits