/
skip.go
44 lines (34 loc) · 1.08 KB
/
skip.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
36
37
38
39
40
41
42
43
44
// Copyright 2014-2015 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package operation
import (
"fmt"
"github.com/juju/juju/worker/uniter/remotestate"
)
type skipOperation struct {
Operation
}
// String is part of the Operation interface.
func (op *skipOperation) String() string {
return fmt.Sprintf("skip %s", op.Operation)
}
// NeedsGlobalMachineLock is part of the Operation interface.
func (op *skipOperation) NeedsGlobalMachineLock() bool {
return false
}
// Prepare is part of the Operation interface.
func (op *skipOperation) Prepare(state State) (*State, error) {
return nil, ErrSkipExecute
}
// Execute is part of the Operation interface.
func (op *skipOperation) Execute(state State) (*State, error) {
return nil, ErrSkipExecute
}
// RemoteStateChanged is called when the remote state changed during execution
// of the operation.
func (op *skipOperation) RemoteStateChanged(snapshot remotestate.Snapshot) {
}
// WrappedOperation is part of the WrappedOperation interface.
func (op *skipOperation) WrappedOperation() Operation {
return op.Operation
}