Revision 67110766
Added by Lukas Zapletal almost 6 years ago
app/models/host_status/build_status.rb | ||
---|---|---|
class BuildStatus < Status
|
||
PENDING = 1
|
||
TOKEN_EXPIRED = 2
|
||
BUILD_FAILED = 3
|
||
BUILT = 0
|
||
|
||
def self.status_name
|
||
... | ... | |
N_("Token expired")
|
||
when BUILT
|
||
N_("Installed")
|
||
when BUILD_FAILED
|
||
N_("Installation error")
|
||
else
|
||
N_("Unknown build status")
|
||
end
|
||
... | ... | |
|
||
def to_global(options = {})
|
||
case to_status
|
||
when TOKEN_EXPIRED
|
||
when TOKEN_EXPIRED, BUILD_FAILED
|
||
HostStatus::Global::ERROR
|
||
else
|
||
HostStatus::Global::OK
|
||
... | ... | |
PENDING
|
||
end
|
||
else
|
||
BUILT
|
||
if build_errors?
|
||
BUILD_FAILED
|
||
else
|
||
BUILT
|
||
end
|
||
end
|
||
end
|
||
|
||
... | ... | |
def token_expired?
|
||
host&.token_expired?
|
||
end
|
||
|
||
def build_errors?
|
||
host && host.build_errors.present?
|
||
end
|
||
end
|
||
end
|
||
|
Also available in: Unified diff
Fixes #21007 - new unattended action 'failed'