-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjuju.go
35 lines (28 loc) · 909 Bytes
/
juju.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright 2014 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package juju
// temporary types to break the state <> apiserver dependency loop
// MachineJob values define responsibilities that machines may be
// expected to fulfil.
type MachineJob string
const (
JobHostUnits MachineJob = "JobHostUnits"
JobManageEnviron MachineJob = "JobManageEnviron"
JobManageNetworking MachineJob = "JobManageNetworking"
// Deprecated in 1.18
JobManageStateDeprecated MachineJob = "JobManageState"
)
// NeedsState returns true if the job requires a state connection.
func (job MachineJob) NeedsState() bool {
return job == JobManageEnviron
}
// AnyJobNeedsState returns true if any of the provided jobs
// require a state connection.
func AnyJobNeedsState(jobs ...MachineJob) bool {
for _, j := range jobs {
if j.NeedsState() {
return true
}
}
return false
}