github.com/wallyworld/juju@v0.0.0-20161013125918-6cf1bc9d917a/apiserver/diskmanager/state.go (about)

     1  // Copyright 2014 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package diskmanager
     5  
     6  import "github.com/juju/juju/state"
     7  
     8  type stateInterface interface {
     9  	SetMachineBlockDevices(machineId string, devices []state.BlockDeviceInfo) error
    10  }
    11  
    12  type stateShim struct {
    13  	*state.State
    14  }
    15  
    16  func (s stateShim) SetMachineBlockDevices(machineId string, devices []state.BlockDeviceInfo) error {
    17  	m, err := s.State.Machine(machineId)
    18  	if err != nil {
    19  		return err
    20  	}
    21  	return m.SetMachineBlockDevices(devices...)
    22  }