diff --git a/inventory_provider/static/update.html b/inventory_provider/static/update.html index 17efc2147fdcf35496a07131e7a42264041b0500..1c44a59273205b46ce21323781489c0f1b53025e 100644 --- a/inventory_provider/static/update.html +++ b/inventory_provider/static/update.html @@ -57,6 +57,20 @@ </table> </div> + <div class="container p-3 my-3 border" ng-show="failed.length"> + <table class="table table-striped" summary="failed tasks"> + <tr> + <th> + <button ng-click="show_failed=!show_failed">{{show_failed ? "hide" : "show"}}</button> + </th> + <th scope="col">failed tasks</th> + </tr> + <tr ng-if="show_failed" ng-repeat="description in failed"> + <td colspan="2">{{ description }}</td> + </tr> + </table> + </div> + <div class="container p-3 my-3 border" ng-show="pending.length"> <table class="table table-striped" summary="pending tasks"> <tr> diff --git a/inventory_provider/static/update.js b/inventory_provider/static/update.js index 15f2f647eccf70c90d5044046b33f2e9e3fb6b50..a4d87b4c74c2e783cd9200d979b9a5cc4f8795b5 100644 --- a/inventory_provider/static/update.js +++ b/inventory_provider/static/update.js @@ -17,6 +17,7 @@ myApp.controller('update', function($scope, $http, $timeout) { $scope.show_warnings = true; $scope.show_errors = true; $scope.show_pending = true; + $scope.show_failed = true; $scope.check_status = function() { @@ -32,6 +33,8 @@ myApp.controller('update', function($scope, $http, $timeout) { $scope.latch_error = rsp.data.latch.failure; if (!$scope.latch_pending) { $scope.update_request_status = ""; + } else { + $scope.update_request_status = "update is running"; } $timeout($scope.check_status, 5000); }, diff --git a/inventory_provider/tasks/worker.py b/inventory_provider/tasks/worker.py index 6264debf9e95d39e86a284946d960f47aee9f6a9..b3c0d748b8f4d9b01e1c1cdd076152d7b6f125c9 100644 --- a/inventory_provider/tasks/worker.py +++ b/inventory_provider/tasks/worker.py @@ -618,6 +618,8 @@ def _wait_for_tasks(task_ids, update_callback=lambda s: None): @log_task_entry_and_exit def refresh_finalizer(self, pending_task_ids_json): + # TODO: if more types of errors appear, use a finally block + input_schema = { "$schema": "http://json-schema.org/draft-07/schema#", "type": "array", @@ -635,7 +637,8 @@ def refresh_finalizer(self, pending_task_ids_json): except (jsonschema.ValidationError, json.JSONDecodeError, - InventoryTaskError) as e: + InventoryTaskError, + RedisError) as e: update_latch_status(InventoryTask.config, failure=True) raise e