github.com/mhilton/juju-juju@v0.0.0-20150901100907-a94dd2c73455/worker/uniter/operation/resolved.go (about)

     1  // Copyright 2014-2015 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package operation
     5  
     6  import (
     7  	"fmt"
     8  
     9  	"github.com/juju/errors"
    10  )
    11  
    12  type resolvedOperation struct {
    13  	Operation
    14  	callbacks Callbacks
    15  }
    16  
    17  // String is part of the Operation interface.
    18  func (op *resolvedOperation) String() string {
    19  	return fmt.Sprintf("clear resolved flag and %s", op.Operation)
    20  }
    21  
    22  // Prepare is part of the Operation interface.
    23  func (op *resolvedOperation) Prepare(state State) (*State, error) {
    24  	if err := op.callbacks.ClearResolvedFlag(); err != nil {
    25  		return nil, errors.Trace(err)
    26  	}
    27  	return op.Operation.Prepare(state)
    28  }