Skip to content

Commit

Permalink
ovn-detrace: Improve DB connection error messages.
Browse files Browse the repository at this point in the history
Fixes: b326503 ("ovn-detrace: Support SSL remotes.")
Signed-off-by: Dumitru Ceara <dceara@redhat.com>
Signed-off-by: Numan Siddique <numans@ovn.org>
  • Loading branch information
dceara authored and numansiddique committed Oct 30, 2020
1 parent fcdac56 commit 24302dc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion utilities/ovn-detrace.in
Expand Up @@ -98,9 +98,12 @@ class OVSDB(object):
OVSDB.STREAM_TIMEOUT_MS)
if not error and strm:
break

sys.stderr.write('Unable to connect to {}, error: {}\n'.format(r,
os.strerror(error)))
strm = None
if not strm:
raise Exception("Unable to connect to %s" % self.remote)
raise Exception('Unable to connect to %s' % self.remote)

rpc = jsonrpc.Connection(strm)
req = jsonrpc.Message.create_request('get_schema', [schema_name])
Expand Down

0 comments on commit 24302dc

Please sign in to comment.