Skip to content

Commit

Permalink
Edit to ensure sequential nulls aren't sent
Browse files Browse the repository at this point in the history
  • Loading branch information
RedProkofiev committed Sep 20, 2023
1 parent 6c9e866 commit f00a96e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ssm/ssm2.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,17 +498,19 @@ def send_all(self):
argo_id = self._send_msg_ams(text, msgid)
if argo_id is not None:
log_string = "Sent %s, Argo ID: %s" % (msgid, argo_id)

Check warning on line 500 in ssm/ssm2.py

View check run for this annotation

Codecov / codecov/patch

ssm/ssm2.py#L500

Added line #L500 was not covered by tests
else:
log_string = "Message %s is empty and returns a None type." % (msgid)

Check warning on line 502 in ssm/ssm2.py

View check run for this annotation

Codecov / codecov/patch

ssm/ssm2.py#L502

Added line #L502 was not covered by tests

else:
# The SSM has been improperly configured
raise Ssm2Exception('Unknown messaging protocol: %s' %
self._protocol)

# log that the message was sent
if 'log_string' in locals():
log.info(log_string)
if log_string[0] == 'M':
log.warning(log_string)

Check warning on line 511 in ssm/ssm2.py

View check run for this annotation

Codecov / codecov/patch

ssm/ssm2.py#L511

Added line #L511 was not covered by tests
else:
log.warning("Message %s is empty and returns a None type.", msgid)
log.info(log_string)

Check warning on line 513 in ssm/ssm2.py

View check run for this annotation

Codecov / codecov/patch

ssm/ssm2.py#L513

Added line #L513 was not covered by tests

self._last_msg = None
self._outq.remove(msgid)
Expand Down

0 comments on commit f00a96e

Please sign in to comment.