Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
fix(service): fix error message
Browse files Browse the repository at this point in the history
  • Loading branch information
hanhxiao committed Sep 26, 2019
1 parent d421ea1 commit 0367334
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gnes/proto/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,14 @@ def check_msg_version(msg: 'gnes_pb2.Message'):
msg.envelope.proto_version, __proto_version__))

if hasattr(msg.envelope, 'vcs_version'):
if not msg.envelope.vcs_version or not os.environ.get('GNES_VCS_VERSION', ''):
if not msg.envelope.vcs_version or not os.environ.get('GNES_VCS_VERSION'):
default_logger.warning('incoming message contains empty "vcs_version", '
'you may ignore it in debug/unittest mode, '
'or if you run gnes OUTSIDE docker container where GNES_VCS_VERSION is unset'
'otherwise please check if frontend service set correct version')
elif os.environ.get('GNES_VCS_VERSION') != msg.envelope.vcs_version:
raise AttributeError('mismatched vcs version! '
'incoming message has protobuf version %s, whereas local protobuf version %s' % (
'incoming message has vcs_version %s, whereas local environment vcs_version is %s' % (
msg.envelope.vcs_version, os.environ.get('GNES_VCS_VERSION')))

if not hasattr(msg.envelope, 'proto_version') and not hasattr(msg.envelope, 'gnes_version'):
Expand Down

0 comments on commit 0367334

Please sign in to comment.