Revision 09cbac87 lib/cmdlib.py
b/lib/cmdlib.py | ||
---|---|---|
196 | 196 |
as values. Rules: |
197 | 197 |
|
198 | 198 |
- use an empty dict if you don't need any lock |
199 |
- if you don't need any lock at a particular level omit that level |
|
199 |
- if you don't need any lock at a particular level omit that |
|
200 |
level (note that in this case C{DeclareLocks} won't be called |
|
201 |
at all for that level) |
|
202 |
- if you need locks at a level, but you can't calculate it in |
|
203 |
this function, initialise that level with an empty list and do |
|
204 |
further processing in L{LogicalUnit.DeclareLocks} (see that |
|
205 |
function's docstring) |
|
200 | 206 |
- don't put anything for the BGL level |
201 |
- if you want all locks at a level use locking.ALL_SET as a value
|
|
207 |
- if you want all locks at a level use L{locking.ALL_SET} as a value
|
|
202 | 208 |
|
203 | 209 |
If you need to share locks (rather than acquire them exclusively) at one |
204 | 210 |
level you can modify self.share_locks, setting a true value (usually 1) for |
... | ... | |
245 | 251 |
self.needed_locks for the level. |
246 | 252 |
|
247 | 253 |
@param level: Locking level which is going to be locked |
248 |
@type level: member of ganeti.locking.LEVELS
|
|
254 |
@type level: member of L{ganeti.locking.LEVELS}
|
|
249 | 255 |
|
250 | 256 |
""" |
251 | 257 |
|
Also available in: Unified diff