VOL-1543 : Fix to properly delete a device from storage
Change-Id: I52d37d947ee6aaf4108fb8252951a123a2829d0c
diff --git a/db/model/node.go b/db/model/node.go
index aeac883..2a9309c 100644
--- a/db/model/node.go
+++ b/db/model/node.go
@@ -501,7 +501,7 @@
}
// Prefix the hash value with the data type (e.g. devices, logical_devices, adapters)
- newChildRev.SetHash(name + "/" + _keyValueType)
+ newChildRev.SetName(name + "/" + _keyValueType)
children[idx] = newChildRev
updatedRev := rev.UpdateChildren(name, children, branch)
@@ -626,10 +626,10 @@
childRev := n.MakeNode(data, "").Latest()
// Prefix the hash with the data type (e.g. devices, logical_devices, adapters)
- childRev.SetHash(name + "/" + key.String())
+ childRev.SetName(name + "/" + key.String())
// Create watch for <component>/<key>
- childRev.SetupWatch(childRev.GetHash())
+ childRev.SetupWatch(childRev.GetName())
children = append(children, childRev)
rev = rev.UpdateChildren(name, children, branch)
@@ -661,7 +661,7 @@
newChildRev := childNode.Add(path, data, txid, makeBranch)
// Prefix the hash with the data type (e.g. devices, logical_devices, adapters)
- childRev.SetHash(name + "/" + keyValue.(string))
+ childRev.SetName(name + "/" + keyValue.(string))
children[idx] = newChildRev
@@ -751,7 +751,7 @@
postAnnouncement = append(postAnnouncement, ChangeTuple{POST_REMOVE, childRev.GetData(), nil})
}
- childRev.Drop(txid, true)
+ childRev.StorageDrop(txid, true)
children = append(children[:idx], children[idx+1:]...)
rev.SetChildren(name, children)
@@ -818,7 +818,7 @@
if !dryRun {
if rev != nil {
- rev.SetHash(dstRev.GetHash())
+ rev.SetName(dstRev.GetName())
n.makeLatest(dstBranch, rev, changes)
}
n.DeleteBranch(txid)