Skip to content

Commit

Permalink
Squash: Handled IOError due to missing files
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>
  • Loading branch information
andy-maier committed Dec 16, 2019
1 parent 04a0471 commit 26c08a4
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions pywbemtools/pywbemcli/_pywbem_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,14 +465,20 @@ def create_connection(self, log=None, use_pull=None, pull_max_cnt=None,
else:
ca_certs = self.ca_certs

conn = PYWBEMCLIConnection(
self.server, creds,
default_namespace=self.default_namespace,
no_verification=no_verification,
x509=x509_dict, ca_certs=ca_certs,
timeout=self.timeout,
use_pull_operations=use_pull,
stats_enabled=timestats)
try:
conn = PYWBEMCLIConnection(
self.server, creds,
default_namespace=self.default_namespace,
no_verification=no_verification,
x509=x509_dict, ca_certs=ca_certs,
timeout=self.timeout,
use_pull_operations=use_pull,
stats_enabled=timestats)
except IOError as exc:
raise click.ClickException(
'Cannot create connection to {}: {}'.
format(self.server, exc))

# Create a WBEMServer object
self._wbem_server = WBEMServer(conn)

Expand Down

0 comments on commit 26c08a4

Please sign in to comment.