[28833] in Source-Commits
moira commit [debian]: Munge output of get_subnet into dotted quad notation for IP ranges.
daemon@ATHENA.MIT.EDU (Anders Kaseorg)
Wed Apr 25 23:50:04 2018
Date: Wed, 25 Apr 2018 23:49:57 -0400
From: Anders Kaseorg <andersk@mit.edu>
Message-Id: <201804260349.w3Q3nvrn025015@drugstore.mit.edu>
To: source-commits@mit.edu
https://github.com/mit-athena/moira/commit/3a4d8b154eda466b98f1b0e959e3a07e0403c38f
commit 3a4d8b154eda466b98f1b0e959e3a07e0403c38f
Author: Garry Zacheiss <zacheiss@mit.edu>
Date: Fri Jun 23 17:38:02 2017 -0400
Munge output of get_subnet into dotted quad notation for IP ranges.
moira/clients/mrtest/qy | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/moira/clients/mrtest/qy b/moira/clients/mrtest/qy
index cee5d87..582ff49 100755
--- a/moira/clients/mrtest/qy
+++ b/moira/clients/mrtest/qy
@@ -200,6 +200,17 @@ foreach (@qret) {
if (!$short) { for (@vals) { s/\\(\d{3})/chr(oct($1))/ge; } }
@out{@retl} = @vals;
+
+ if ($query[0]eq "gsnt" || $query[0] eq "get_subnet") {
+ my ($dotted_quad);
+ foreach $arg ('address', 'mask', 'low', 'high') {
+ $dotted_quad = inet_ntoa(pack('N', $out{$arg}));
+ if ($dotted_quad) {
+ $out{$arg} = $dotted_quad;
+ }
+ }
+ }
+
if ($short) {
print join ", ", map { if (defined $out{$_}) {
"$out{$_}";