diff --git a/confluent_client/confluent/logreader.py b/confluent_client/confluent/logreader.py index 94034d06..5bb14892 100644 --- a/confluent_client/confluent/logreader.py +++ b/confluent_client/confluent/logreader.py @@ -282,14 +282,19 @@ def _replay_to_console(txtfile, binfile): def replay_to_console(txtfile): if os.path.exists(txtfile + '.cbl'): binfile = txtfile + '.cbl' + elif '.' not in txtfile: + if '/' not in txtfile: + txtfile = os.getcwd() + '/' + txtfile + sys.stderr.write('Unable to locate cbl file: "{0}"\n'.format(txtfile + '.cbl')) + sys.exit(1) else: fileparts = txtfile.split('.') prefix = '.'.join(fileparts[:-1]) binfile = prefix + '.cbl.' + fileparts[-1] if not os.path.exists(binfile): - sys.stderr.write('Unable to locate cbl file\n') + sys.stderr.write('Unable to locate cbl file: "{0}"\n'.format(binfile)) sys.exit(1) _replay_to_console(txtfile, binfile) if __name__ == '__main__': - replay_to_console(sys.argv[1]) \ No newline at end of file + replay_to_console(sys.argv[1])