Skip to content

Commit

Permalink
mogadm: do not warn about drain unless drain is specified
Browse files Browse the repository at this point in the history
Unnecessarily displaying the warning about "drain" is potentially
confusing and scary to new users, especially if they've never
used MogileFS before.
  • Loading branch information
Eric Wong authored and dormando committed Aug 8, 2013
1 parent 2818247 commit c248e62
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions mogadm
Original file line number Diff line number Diff line change
Expand Up @@ -769,10 +769,17 @@ sub cmd_device_add {
ok('Device added.');
}

sub warn_on_drain {
my $args = shift;
if ($args->{status} && $args->{status} eq 'drain') {
print "***NOTE***: As of server version 2.40 'drain' has changed. See docs/wiki\n";
}
}

sub cmd_device_mark {
my $args = shift;

print "***NOTE***: As of server version 2.40 'drain' has changed. See docs/wiki\n";
warn_on_drain($args);
my $mogadm = mogadm();
$mogadm->change_device_state($args->{hostname},
$args->{devid},
Expand All @@ -789,7 +796,7 @@ sub cmd_device_modify {
my $hostname = delete $args->{hostname};
my $devid = delete $args->{devid};

print "***NOTE***: As of server version 2.40 'drain' has changed. See docs/wiki\n";
warn_on_drain($args);
my $mogadm = mogadm();
$mogadm->update_device($hostname, $devid, $args);

Expand Down

0 comments on commit c248e62

Please sign in to comment.