Revision 0623d351 lib/backend.py
b/lib/backend.py | ||
---|---|---|
323 | 323 |
|
324 | 324 |
try: |
325 | 325 |
priv_key, pub_key, auth_keys = ssh.GetUserFiles(constants.GANETI_RUNAS) |
326 |
except errors.OpExecError: |
|
327 |
logging.exception("Error while processing ssh files") |
|
328 |
return |
|
329 | 326 |
|
330 |
f = open(pub_key, 'r') |
|
331 |
try: |
|
332 |
utils.RemoveAuthorizedKey(auth_keys, f.read(8192)) |
|
333 |
finally: |
|
334 |
f.close() |
|
327 |
f = open(pub_key, 'r')
|
|
328 |
try:
|
|
329 |
utils.RemoveAuthorizedKey(auth_keys, f.read(8192))
|
|
330 |
finally:
|
|
331 |
f.close()
|
|
335 | 332 |
|
336 |
utils.RemoveFile(priv_key) |
|
337 |
utils.RemoveFile(pub_key) |
|
333 |
utils.RemoveFile(priv_key) |
|
334 |
utils.RemoveFile(pub_key) |
|
335 |
except errors.OpExecError: |
|
336 |
logging.exception("Error while processing ssh files") |
|
338 | 337 |
|
339 |
# Return a reassuring string to the caller, and quit
|
|
340 |
raise errors.QuitGanetiException(False, 'Shutdown scheduled')
|
|
338 |
# Raise a custom exception (handled in ganeti-noded)
|
|
339 |
raise errors.QuitGanetiException(True, 'Shutdown scheduled')
|
|
341 | 340 |
|
342 | 341 |
|
343 | 342 |
def GetNodeInfo(vgname, hypervisor_type): |
Also available in: Unified diff