Revision 1310339c src/Ganeti/Locking/Locks.hs
b/src/Ganeti/Locking/Locks.hs | ||
---|---|---|
55 | 55 |
| ClusterLockSet |
56 | 56 |
| InstanceLockSet |
57 | 57 |
| Instance String |
58 |
| NodeGroupLockSet |
|
59 |
| NodeGroup String |
|
60 | 58 |
| NodeAllocLockSet |
61 | 59 |
| NAL |
62 |
| NodeResLockSet
|
|
63 |
| NodeRes String
|
|
60 |
| NodeGroupLockSet
|
|
61 |
| NodeGroup String
|
|
64 | 62 |
| NodeLockSet |
65 | 63 |
| Node String |
64 |
| NodeResLockSet |
|
65 |
| NodeRes String |
|
66 | 66 |
deriving (Ord, Eq, Show) |
67 | 67 |
|
68 |
-- | Provide teh String representation of a lock
|
|
68 |
-- | Provide the String representation of a lock
|
|
69 | 69 |
lockName :: GanetiLocks -> String |
70 | 70 |
lockName BGL = "cluster/BGL" |
71 | 71 |
lockName ClusterLockSet = "cluster/[lockset]" |
72 | 72 |
lockName InstanceLockSet = "instance/[lockset]" |
73 |
lockName NodeAllocLockSet = "node-alloc/[lockset]" |
|
74 |
lockName NAL = "node-alloc/NAL" |
|
73 | 75 |
lockName (Instance uuid) = "instance/" ++ uuid |
74 | 76 |
lockName NodeGroupLockSet = "nodegroup/[lockset]" |
75 | 77 |
lockName (NodeGroup uuid) = "nodegroup/" ++ uuid |
76 |
lockName NodeAllocLockSet = "node-alloc/[lockset]" |
|
77 |
lockName NAL = "node-alloc/NAL" |
|
78 |
lockName NodeResLockSet = "node-res/[lockset]" |
|
79 |
lockName (NodeRes uuid) = "node-res/" ++ uuid |
|
80 | 78 |
lockName NodeLockSet = "node/[lockset]" |
81 | 79 |
lockName (Node uuid) = "node/" ++ uuid |
80 |
lockName NodeResLockSet = "node-res/[lockset]" |
|
81 |
lockName (NodeRes uuid) = "node-res/" ++ uuid |
|
82 | 82 |
|
83 | 83 |
-- | Obtain a lock from its name. |
84 | 84 |
lockFromName :: String -> J.Result GanetiLocks |
Also available in: Unified diff