@ -309,9 +309,11 @@ func LockResources(event Event) error {
for _, resource := range(locked_resources) {
UnlockResource(resource, event)
}
log.Logf("event", "RESOURCE_LOCK_FAIL for %s: %s", event.Name(), lock_err)
return lock_err
log.Logf("event", "RESOURCE_LOCK_SUCCESS for %s", event.Name())
signal := NewDownSignal(event, "locked")
SendUpdate(event, signal)
@ -52,10 +52,16 @@ type Resource interface {
LockState()
UnlockState()
String() string
lock(node GraphNode) error
unlock(node GraphNode) error
func (resource * BaseResource) String() string {
return resource.Name()
// Recurse up cur's parents to ensure r is not present
func checkIfParent(r Resource, cur Resource) bool {
if r == nil || cur == nil {