Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-7529

Fix failure to fail

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: ctrl_pool
    • Labels:
      None
    • Story Points:
      0.1
    • Epic Link:
    • Sprint:
      DRP F16-4
    • Team:
      Data Release Production

      Description

      When there's no data available, BatchTaskRunner falls over because log is a module rather than a logging object.

        Attachments

          Issue Links

            Activity

            Hide
            price Paul Price added a comment -

            Super-easy review for you, if you don't mind, John Swinbank:

            price@price-laptop:~/LSST/ctrl/pool (tickets/DM-7529=) $ git sub-patch
            commit 522fd05f39d3b6904545283bb59caf26eabc29a7
            Author: Paul Price <price@astro.princeton.edu>
            Date:   Tue Sep 6 14:46:16 2016 -0400
             
                fix failure to fail
                
                When no data was available, BatchTaskRunner would fall over because
                'log' was a module rather than a logging object.
             
            diff --git a/python/lsst/ctrl/pool/parallel.py b/python/lsst/ctrl/pool/parallel.py
            index 9dae4f8..72c2411 100644
            --- a/python/lsst/ctrl/pool/parallel.py
            +++ b/python/lsst/ctrl/pool/parallel.py
            @@ -515,7 +515,7 @@ class BatchTaskRunner(TaskRunner):
                             # Run the task using self.__call__
                             resultList = pool.map(self, targetList)
                         else:
            -                log.warn("Not running the task because there is no data to process; "
            +                parsedCmd.log.warn("Not running the task because there is no data to process; "
                                 "you may preview data using \"--show data\"")
                             resultList = []
             
            

            Show
            price Paul Price added a comment - Super-easy review for you, if you don't mind, John Swinbank : price@price-laptop:~/LSST/ctrl/pool (tickets/DM-7529=) $ git sub-patch commit 522fd05f39d3b6904545283bb59caf26eabc29a7 Author: Paul Price <price@astro.princeton.edu> Date: Tue Sep 6 14:46:16 2016 -0400   fix failure to fail When no data was available, BatchTaskRunner would fall over because 'log' was a module rather than a logging object.   diff --git a/python/lsst/ctrl/pool/parallel.py b/python/lsst/ctrl/pool/parallel.py index 9dae4f8..72c2411 100644 --- a/python/lsst/ctrl/pool/parallel.py +++ b/python/lsst/ctrl/pool/parallel.py @@ -515,7 +515,7 @@ class BatchTaskRunner(TaskRunner): # Run the task using self.__call__ resultList = pool.map(self, targetList) else: - log.warn("Not running the task because there is no data to process; " + parsedCmd.log.warn("Not running the task because there is no data to process; " "you may preview data using \"--show data\"") resultList = []
            Hide
            swinbank John Swinbank added a comment -

            .

            Although it does remind me that we really need to add some tests to ctrl_pool. Out of scope here, though.

            Show
            swinbank John Swinbank added a comment - . Although it does remind me that we really need to add some tests to ctrl_pool. Out of scope here, though.
            Hide
            price Paul Price added a comment -

            Thanks!

            Merged to master.

            Show
            price Paul Price added a comment - Thanks! Merged to master.

              People

              • Assignee:
                price Paul Price
                Reporter:
                price Paul Price
                Reviewers:
                John Swinbank
                Watchers:
                John Swinbank, Paul Price
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel