All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit cf6dd622 authored by Leigh B Stoller's avatar Leigh B Stoller

Add convenience methods, add panic/shutdown flags to status blob.

parent 73391fe9
...@@ -334,7 +334,10 @@ sub GetCertificate($) ...@@ -334,7 +334,10 @@ sub GetCertificate($)
sub resource_type($) { return field($_[0], "type"); } sub resource_type($) { return field($_[0], "type"); }
# Busy if status is working (start/restart/stop/reload/reboot). # Busy if status is working (start/restart/stop/reload/reboot).
sub Working($) { return $_[0]->status eq "working" ? 1 : 0; } sub Busy($) { return $_[0]->status eq "working" ? 1 : 0; }
# Are any slivers imaging.
sub Imaging($) { return $_[0]->CheckSliverStates("imaging") ? 1 : 0; }
# A place to stash a temporary rspec. # A place to stash a temporary rspec.
sub rspec($;$) sub rspec($;$)
...@@ -3821,12 +3824,16 @@ sub CancelUpdateAccounts($) ...@@ -3821,12 +3824,16 @@ sub CancelUpdateAccounts($)
sub GenerateStatusBlob($) sub GenerateStatusBlob($)
{ {
my ($self) = @_; my ($self) = @_;
my $slice = $self->GetSlice();
my $slice_experiment = $slice->GetExperiment();
my $sliver_urn = $self->sliver_urn(); my $sliver_urn = $self->sliver_urn();
my $resource_id = $self->resource_id(); my $resource_id = $self->resource_id();
my $state = $self->state(); my $state = $self->state();
my $status = $self->status(); my $status = $self->status();
my $nickname = $self->nickname() || ""; my $nickname = $self->nickname() || "";
my $shutdown = $slice->isshutdown();
my $paniced = $slice_experiment->paniced();
# New is the same as stopped. Separate state is handy. # New is the same as stopped. Separate state is handy.
$state = "stopped" $state = "stopped"
...@@ -3839,6 +3846,8 @@ sub GenerateStatusBlob($) ...@@ -3839,6 +3846,8 @@ sub GenerateStatusBlob($)
"status" => $status, "status" => $status,
"error" => "", "error" => "",
"utc" => time(), "utc" => time(),
"shutdown" => $shutdown,
"paniced" => $paniced,
}; };
return $blob; return $blob;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment