Skip to content

Commit

Permalink
Merge pull request #16 from clowder-framework/fix-status-bug
Browse files Browse the repository at this point in the history
Fix status bug
  • Loading branch information
robkooper authored Sep 18, 2020
2 parents cac8426 + 8105160 commit 4489c7a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## 2.3.1 - 2020-09-18

With this version we no longer gurantee support for versions of python below 3.

### Fixed
- There was an issue where status messages could cause an exception. This would prevent most extractors from running correctly.

## 2.3.0 - 2020-09-15

**CRITICAL BUG IN THIS VERSION. PLEASE USE VERSION 2.3.1**

Removed develop branch, all pull requests will need to be against master from now
forward. Please update version number in setup.py in each PR.

Expand Down
14 changes: 7 additions & 7 deletions pyclowder/connectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ def _process_message(self, body):
self.register_extractor("%s?key=%s" % (url, secret_key))

# tell everybody we are starting to process the file
self.status_update(pyclowder.utils.StatusMessage.start.value, resource, "Started processing.")
self.status_update(pyclowder.utils.StatusMessage.start, resource, "Started processing.")

# checks whether to process the file in this message or not
# pylint: disable=too-many-nested-blocks
Expand Down Expand Up @@ -455,7 +455,7 @@ def _process_message(self, body):
logger.exception("Error removing temporary dataset directory")

else:
self.status_update(pyclowder.utils.StatusMessage.skip.value, resource, "Skipped in check_message")
self.status_update(pyclowder.utils.StatusMessage.skip, resource, "Skipped in check_message")

self.message_ok(resource)

Expand Down Expand Up @@ -534,16 +534,16 @@ def status_update(self, status, resource, message):
logging.getLogger(__name__).info("[%s] : %s: %s", resource["id"], status, message)

def message_ok(self, resource, message="Done processing."):
self.status_update(pyclowder.utils.StatusMessage.done.value, resource, message)
self.status_update(pyclowder.utils.StatusMessage.done, resource, message)

def message_error(self, resource, message="Error processing message."):
self.status_update(pyclowder.utils.StatusMessage.error.value, resource, message)
self.status_update(pyclowder.utils.StatusMessage.error, resource, message)

def message_resubmit(self, resource, retry_count, message="Resubmitting message."):
self.status_update(pyclowder.utils.StatusMessage.retry.value, resource, message)
self.status_update(pyclowder.utils.StatusMessage.retry, resource, message)

def message_process(self, resource, message):
self.status_update(pyclowder.utils.StatusMessage.processing.value, resource, message)
self.status_update(pyclowder.utils.StatusMessage.processing, resource, message)

def get(self, url, params=None, raise_status=True, **kwargs):
"""
Expand Down Expand Up @@ -938,7 +938,7 @@ def status_update(self, status, resource, message):
"job_id": self.job_id,
"status": "%s: %s" % (status, message),
"start": pyclowder.utils.iso8601time(),
"message_type": status,
"message_type": "%s" % status,
"message": message
}})

Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
enum34==1.1.6
pika==1.1.0
PyYAML==5.1
requests==2.24.0
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def description():


setup(name='pyclowder',
version='2.3.0',
version='2.3.1',
packages=find_packages(),
description='Python SDK for the Clowder Data Management System',
long_description=description(),
Expand All @@ -32,6 +32,7 @@ def description():
keywords=['clowder', 'data management system'],

install_requires=[
'enum34==1.1.6',
'pika==1.1.0',
'PyYAML==5.1',
'requests==2.24.0',
Expand Down

0 comments on commit 4489c7a

Please sign in to comment.