From 5e1e8f4c3c35ade9bbe052936497f89e2c866578 Mon Sep 17 00:00:00 2001 From: lars4839 Date: Tue, 16 May 2017 19:17:36 -0500 Subject: [PATCH] Raise more descriptive error with zero-length password. Fixes #62 --- docs/source/changelog.rst | 2 ++ virtualbox/library_ext/guest.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst index d761ffe..de99828 100644 --- a/docs/source/changelog.rst +++ b/docs/source/changelog.rst @@ -3,6 +3,8 @@ Change log master +* IGuest.create_session() now raises a more descriptive error if + not able to connect with a zero-length password. (@SethMichaelLarson PR #70) * Add sys.executable-derived paths in list to check for vboxapi (@SethMichaelLarson PR #69) * Fix IGuestProcess.execute() on Python 3.x (@SethMichaelLarson PR #58) * Fix errors to not output on Windows platforms. (@SethMichaelLarson PR #57) diff --git a/virtualbox/library_ext/guest.py b/virtualbox/library_ext/guest.py index 86fb488..0eca2f2 100644 --- a/virtualbox/library_ext/guest.py +++ b/virtualbox/library_ext/guest.py @@ -21,6 +21,9 @@ def create_session(self, user, password, domain='', session_name='pyvbox', break time.sleep(0.1) else: + if len(password) == 0: + raise SystemError('GuestSession failed to start. Could be because ' + 'of using an empty password.') raise SystemError("GuestSession failed to start") if timeout_ms != 0: # There is probably a better way to to this?