Skip to content

Commit

Permalink
Reorder imports, move comment, use logging.warning
Browse files Browse the repository at this point in the history
- Reorder argo_ams_library imports alphabetically.
- Move comment to more logical position.
- Change logging.warn to .warning as former is deprecating.
  • Loading branch information
tofu-rocketry committed Jun 12, 2023
1 parent bda9e02 commit e266757
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ssm/ssm2.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
from logging import getLogger, INFO, WARNING, DEBUG

try:
from argo_ams_library import ArgoMessagingService, AmsMessage, AmsServiceException
from argo_ams_library import AmsMessage, ArgoMessagingService, AmsServiceException
except ImportError:
# ImportError is raised later on if AMS is requested but lib not installed.
ArgoMessagingService = None
Expand Down Expand Up @@ -494,8 +494,8 @@ def send_all(self):
log_string = "Sent %s" % msgid

elif self._protocol == Ssm2.AMS_MESSAGING:
# Then we are sending to an Argo Messaging Service instance.
try:
# Then we are sending to an Argo Messaging Service instance.
argo_id = self._send_msg_ams(text, msgid)
log_string = "Sent %s, Argo ID: %s" % (msgid, argo_id)

Expand All @@ -504,7 +504,7 @@ def send_all(self):
if "Message size is too large" not in str(e):
raise
else:
log.warn('Message %s could not be sent as its larger than 1MB', msgid)
log.warning('Message %s could not be sent as its larger than 1MB', msgid)

# Add the message to the rejected queue
name = self._rejectq.add(text)
Expand Down

0 comments on commit e266757

Please sign in to comment.