Revision 3ecf6786 daemons/ganeti-watcher
b/daemons/ganeti-watcher | ||
---|---|---|
117 | 117 |
fcntl.flock(f.fileno(), fcntl.LOCK_EX|fcntl.LOCK_NB) |
118 | 118 |
except IOError, x: |
119 | 119 |
if x.errno == errno.EAGAIN: |
120 |
raise StandardError('State file already locked')
|
|
120 |
raise StandardError("State file already locked")
|
|
121 | 121 |
raise |
122 | 122 |
|
123 | 123 |
self.statefile = f |
... | ... | |
202 | 202 |
self.state = state |
203 | 203 |
|
204 | 204 |
def Restart(self): |
205 |
"""Encapsulates the start of an instance. |
|
206 |
|
|
207 |
This is currently done using the command line interface and not |
|
208 |
the Ganeti modules. |
|
209 |
|
|
210 |
""" |
|
205 | 211 |
DoCmd(['gnt-instance', 'startup', '--lock-retries=15', self.name]) |
206 | 212 |
|
207 | 213 |
|
... | ... | |
258 | 264 |
sstore = ssconf.SimpleStore() |
259 | 265 |
master = sstore.GetMasterNode() |
260 | 266 |
if master != socket.gethostname(): |
261 |
raise NotMasterError, ("This is not the master node")
|
|
267 |
raise NotMasterError("This is not the master node") |
|
262 | 268 |
self.instances = InstanceList() |
263 | 269 |
self.messages = [] |
264 | 270 |
|
Also available in: Unified diff