diff --git a/inventory_provider/routes/jobs.py b/inventory_provider/routes/jobs.py index 74b8b253520c79e60b78f202a681b1c1ea812f44..af879679526263d59d14093f99f149bb80a47169 100644 --- a/inventory_provider/routes/jobs.py +++ b/inventory_provider/routes/jobs.py @@ -110,7 +110,6 @@ def load_task_log(): if 'task-received' in task: event = task['task-received'][0] description = f'{event["name"]}{event["args"]}' - description += f':{event["uuid"]}' if 'task-failed' in task: if not description: diff --git a/inventory_provider/snmp.py b/inventory_provider/snmp.py index 7947cf35382cff01595b33f5d42f5f54b6536e2f..92cc3a835a1c7e00a9abbe9b51ea11cb41e1e1ea 100644 --- a/inventory_provider/snmp.py +++ b/inventory_provider/snmp.py @@ -74,7 +74,7 @@ def walk(agent_hostname, community, base_oid): # pragma: no cover 'snmp response pdu error %r at %r' % ( pduErrorIndication, errorIndex and varBinds[int(errorIndex) - 1][0] or '?')) - if errorIndex == 0: + if errorIndex != 0: raise SNMPWalkError( 'sanity failure: errorIndex != 0, ' 'but no error indication') diff --git a/inventory_provider/static/update.html b/inventory_provider/static/update.html index c460d14740a8be22049c335c8f397569eea0abf6..774860fff1f1ac35a6d9ac2aa22edc8942c74b83 100644 --- a/inventory_provider/static/update.html +++ b/inventory_provider/static/update.html @@ -13,57 +13,66 @@ <body> <div ng-controller="update"> - <div class="grid-container"> - <div class="grid-item"> + <div class="container p-3 my-3"> <button type="button" class="btn btn-primary btn-lg" ng-click="launch_update()" ng-disabled="latch_pending">Update Inventory Provider</button> </div> - <div class="grid-item" ng-class="latch_error||update_request_error ? 'error' : 'ok'"> + <div class="container p-3 my-3 border" ng-class="latch_error||update_request_error ? 'error' : 'ok'"> {{ latch_info }} </div> - <div class="grid-item" ng-class="update_request_error ? 'error' : 'ok'"> + <div class="container p-3 my-3" ng-class="update_request_error ? 'error' : 'ok'"> {{ update_request_status }} </div> - <span class="grid-item" ng-show="errors.length"> + <div class="container p-3 my-3 border" ng-show="errors.length"> <table class="table table-striped" summary="error messages"> <tr> - <th scope="col">errorss</th> + <th> + <button ng-click="show_errors=!show_errors">{{show_errors ? "hide" : "show"}}</button> + </th> + <th scope="col">errors</th> </tr> - <tr ng-repeat="description in errors"> + <tr ng-if="show_errors" ng-repeat="description in errors"> <td>{{ description }}</td> </tr> </table> - </span> + </div> - <span class="grid-item" ng-show="warnings.length"> + <div class="container p-3 my-3 border" ng-show="warnings.length"> <table class="table table-striped" summary="warning messages"> <tr> + <th> + <button ng-click="show_warnings=!show_warnings">{{show_warnings ? "hide" : "show"}}</button> + </th> <th scope="col">warnings</th> </tr> - <tr ng-repeat="description in warnings"> + <tr ng-if="show_warnings" ng-repeat="description in warnings"> + <td></td> <td>{{ description }}</td> </tr> </table> - </span> + </div> - <span class="grid-item" ng-show="pending.length"> + <div class="container p-3 my-3 border" ng-show="pending.length"> <table class="table table-striped" summary="pending tasks"> <tr> + <th> + <button ng-click="show_pending=!show_pending">{{show_pending ? "hide" : "show"}}</button> + </th> <th scope="col">pending tasks</th> </tr> - <tr ng-repeat="description in pending"> + <tr ng-if="show_pending" ng-repeat="description in pending"> <td>{{ description }}</td> </tr> </table> - </span> + </div> </div> - </div> + </body> </html> \ No newline at end of file diff --git a/inventory_provider/static/update.js b/inventory_provider/static/update.js index 11d7004c08ef260a5238bc9883c74090476ff2c0..15f2f647eccf70c90d5044046b33f2e9e3fb6b50 100644 --- a/inventory_provider/static/update.js +++ b/inventory_provider/static/update.js @@ -14,6 +14,10 @@ myApp.controller('update', function($scope, $http, $timeout) { $scope.errors = []; $scope.warnings = []; + $scope.show_warnings = true; + $scope.show_errors = true; + $scope.show_pending = true; + $scope.check_status = function() { $http({