Skip to content

Commit

Permalink
0.9.2-16 - *hcpsdk.Connection.close()* now checks if the underlying c…
Browse files Browse the repository at this point in the history
…onnection is really open before trying to close it.
  • Loading branch information
Simont3 committed Mar 22, 2015
1 parent a0e528a commit 2bb7741
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 7 deletions.
Binary file modified Documentation/HCPsdk.pdf
Binary file not shown.
7 changes: 7 additions & 0 deletions src/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Release History
===============

**0.9.2-16 2015-03-22**

* Fixed:

*hcpsdk.Connection.close()* now checks if the underlying connection
is really open before trying to close it.

**0.9.2-15 2015-03-22**

* Fixed:
Expand Down
7 changes: 7 additions & 0 deletions src/docs/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Release History
===============

**0.9.2-16 2015-03-22**

* Fixed:

*hcpsdk.Connection.close()* now checks if the underlying connection
is really open before trying to close it.

**0.9.2-15 2015-03-22**

* Fixed:
Expand Down
13 changes: 7 additions & 6 deletions src/hcpsdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,12 +731,13 @@ def close(self):
be canceled on *close()*.
"""
# noinspection PyBroadException
try:
self._cancel_idletimer()
self.__con.close()
except Exception as e:
self.logger.exception('Connection object close failed: IP {} ({})'
.format(self.__address, self.__target.fqdn))
if self.__con:
try:
self._cancel_idletimer()
self.__con.close()
except Exception as e:
self.logger.exception('Connection object close failed: IP {} ({})'
.format(self.__address, self.__target.fqdn))

self.logger.log(logging.DEBUG, 'Connection object closed: IP {} ({})'
.format(self.__address, self.__target.fqdn))
Expand Down
2 changes: 1 addition & 1 deletion src/hcpsdk/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class _Version(object):
release = 0
major = 9
minor = 2
build = 15
build = 16

fullversion = '{}.{}.{}-{}'.format(release, major, minor, build)

Expand Down

0 comments on commit 2bb7741

Please sign in to comment.