[1999] in Moira Commits
/svn/moira r4138 - trunk/moira/incremental/route-server
daemon@ATHENA.MIT.EDU (Garry Zacheiss)
Thu Aug 29 16:31:06 2013
Date: Thu, 29 Aug 2013 16:30:59 -0400
From: Garry Zacheiss <zacheiss@MIT.EDU>
Message-Id: <201308292030.r7TKUxav000794@drugstore.mit.edu>
To: moira-commits@MIT.EDU
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Author: zacheiss
Date: 2013-08-29 16:30:59 -0400 (Thu, 29 Aug 2013)
New Revision: 4138
Modified:
trunk/moira/incremental/route-server/route-server.incr
Log:
Don't bother giving web service previous state anymore.
Modified: trunk/moira/incremental/route-server/route-server.incr
===================================================================
--- trunk/moira/incremental/route-server/route-server.incr 2013-08-26 15:26:52 UTC (rev 4137)
+++ trunk/moira/incremental/route-server/route-server.incr 2013-08-29 20:30:59 UTC (rev 4138)
@@ -84,22 +84,11 @@
my (@moira_input) = @_;
$before_address = $moira_input[$ADDRESS_POS];
- $before_option = $moira_input[$OPT_POS];
- if ($before_option == 0) {
- $before_state = "none";
- } elsif ($before_option == 1 || $before_option == 2) {
- $before_state = "optout";
- } elsif ($before_option == 3) {
- $before_state = "blackhole";
- } else {
- critical_alert("$whoami: Unexpected machine opt $before_option");
- }
-
if ($after_len == 0) {
# machine deletion
if ($before_address ne "unassigned") {
- update_route_server("none", $before_state, $before_address);
+ update_route_server("none", $before_address);
}
} else {
@@ -122,15 +111,15 @@
if ($before_address ne "unassigned") {
# Delete the address that's no longer in use.
- update_route_server("none", $before_state, $before_address);
+ update_route_server("none", $before_address);
}
if ($after_address ne "unassigned") {
- update_route_server($after_state, "none", $after_address);
+ update_route_server($after_state, $after_address);
}
} else {
if ($after_address ne "unassigned") {
- update_route_server($after_state, $before_state, $after_address);
+ update_route_server($after_state, $after_address);
}
}
}
@@ -140,11 +129,10 @@
sub update_route_server {
- my ($state, $prevstate, $address) = @_;
+ my ($state, $address) = @_;
my %outhash = ();
$outhash{'state'} = $state;
- $outhash{'prevstate'} = $prevstate;
$outhash{'ip'} = $address;
my $json = encode_json(\%outhash);