NAUbackup / VmBackup

XenServer simple backup script
228 stars 61 forks source link

Sessions not logged out #6

Closed robhoes closed 9 years ago

robhoes commented 9 years ago

Hi there, nice script! Here is a suggestion for improvement:

I noticed that XenAPI sessions are setup using session.login_with_password, but they don't seem to be logged out off at the end (session.logout). This means that each time you run the script, you leak a session.

A session logout does not happen automatically when breaking the connection with the server, because sessions can be reused across connections (a session is just an authentication token).

Sessions are a limited resource in xapi, so it is best logout your session as soon as it is no longer needed.

NAUbackup commented 9 years ago

Hi, thanks for pointing that out. I have added the session.logout