branch develop updated (40c8d67 -> e25ed00)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository mum. See http://git.chorem.org/mum.git from 40c8d67 navbar: current tasks running on the center of navbar (number of max tasks defined on headCtrl) new 1c0d817 monitoring module instruction also removed from database if exception occures (as well if no connection have been found) new 4754716 bug on external module loading corrected + hostpage select all avaliable on block selection new 4727ac1 changed all asynchronous $scope.$apply on js to $timeout in order to prevent "inprog" angular errors new e25ed00 handled exceptions on module loader + print traceback + bug fix on full detection The 4 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit e25ed006647ff08540ccbe37353d4224695608cb Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Apr 17 16:15:03 2015 +0200 handled exceptions on module loader + print traceback + bug fix on full detection commit 4727ac1ba63db144afc20b3e14e35db75ba2b6fb Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Apr 17 15:27:01 2015 +0200 changed all asynchronous $scope.$apply on js to $timeout in order to prevent "inprog" angular errors commit 475471624be023f21b8a8a977a568041be08d4f9 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Apr 17 14:48:21 2015 +0200 bug on external module loading corrected + hostpage select all avaliable on block selection commit 1c0d81779263f6a6cf7e6c5dd36e5dc1e908683b Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Apr 17 11:50:56 2015 +0200 monitoring module instruction also removed from database if exception occures (as well if no connection have been found) Summary of changes: app/module_loader.py | 64 +++++++++++++++++++++++++----- app/mum.py | 7 +++- static/js/controllers/hostPageCtrl.js | 56 +++++++++++++++----------- static/js/controllers/notificationsCtrl.js | 20 +++++----- static/js/controllers/profileCtrl.js | 16 ++++---- static/js/controllers/settingsCtrl.js | 6 +-- static/js/controllers/usersCtrl.js | 10 ++--- views/hostpage.html | 2 + views/settings.html | 4 +- 9 files changed, 122 insertions(+), 63 deletions(-) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository mum. See http://git.chorem.org/mum.git commit 1c0d81779263f6a6cf7e6c5dd36e5dc1e908683b Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Apr 17 11:50:56 2015 +0200 monitoring module instruction also removed from database if exception occures (as well if no connection have been found) --- app/module_loader.py | 25 +++++++++++++++++++++++++ static/js/controllers/hostPageCtrl.js | 1 + 2 files changed, 26 insertions(+) diff --git a/app/module_loader.py b/app/module_loader.py index 1ab1618..0d43201 100644 --- a/app/module_loader.py +++ b/app/module_loader.py @@ -260,10 +260,15 @@ class ModuleLoader: # getting all availiable connections for this part to check compatible_conn = self.loaded_mod_moni[part_name]['compatible_conn'] conf_conn = self.db.get_conf_conn(addr_host) + conn_found = False for i in range(len(conf_conn)): + # for each connection that have been configurated for this host (by priority) for mod in self.loaded_mod_moni[part_name]['modules']: + # for each monitoring module, being from this part, activated for this host loaded_mod = self.loaded_mod_moni[part_name]['modules'][mod]['imported'] if getattr(loaded_mod, 'connection') == conf_conn[i]['conn_mod_name']: + # if this monitoring module is compatible for the current connection + conn_found = True try: conn_inst = self.create_connection(addr_host, conf_conn[i]) dict_notif = getattr(self.loaded_mod_moni[part_name]['modules'][mod]['imported'], @@ -274,13 +279,33 @@ class ModuleLoader: except modules.ModuleNotCompatibleException.ModuleNotCompatibleException as mnce: print mnce.__str__() process_monitoring.remove_to_waiting_list(addr_host, part_name) + dict_deactivation_request = {} + dict_deactivation_request['addr_host'] = addr_host + dict_deactivation_request['activated'] = {part_name: False} + self.db.config_mod_activation(dict_deactivation_request) except modules.CommandNotFoundException.CommandNotFoundException as cnfe: print cnfe.__str__() process_monitoring.remove_to_waiting_list(addr_host, part_name) + dict_deactivation_request = {} + dict_deactivation_request['addr_host'] = addr_host + dict_deactivation_request['activated'] = {part_name: False} + self.db.config_mod_activation(dict_deactivation_request) except Exception: print "Monitoring module " + part_name + " have been disabled on " + addr_host + \ " because of an unexpected error." process_monitoring.remove_to_waiting_list(addr_host, part_name) + dict_deactivation_request = {} + dict_deactivation_request['addr_host'] = addr_host + dict_deactivation_request['activated'] = {part_name: False} + self.db.config_mod_activation(dict_deactivation_request) + if not conn_found: + print "No necessary connection have been configured for " + part_name + " on " + addr_host +\ + ". Therefore it has been deactivated." + process_monitoring.remove_to_waiting_list(addr_host, part_name) + dict_deactivation_request = {} + dict_deactivation_request['addr_host'] = addr_host + dict_deactivation_request['activated'] = {part_name: False} + self.db.config_mod_activation(dict_deactivation_request) def get_monitoring_modules_list(self): """ diff --git a/static/js/controllers/hostPageCtrl.js b/static/js/controllers/hostPageCtrl.js index 858b796..348f781 100644 --- a/static/js/controllers/hostPageCtrl.js +++ b/static/js/controllers/hostPageCtrl.js @@ -195,6 +195,7 @@ mumApp.controller('hostPageCtrl', function($scope, $rootScope, $route, $routePar var modalInstance = $modal.open({ templateUrl: 'modal_block_label.html', controller: 'ModalBlockInstanceCtrl', + size: 'lg', resolve: { block_args: function(){ return {'addr_host' : $scope.addr_host, -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository mum. See http://git.chorem.org/mum.git commit 475471624be023f21b8a8a977a568041be08d4f9 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Apr 17 14:48:21 2015 +0200 bug on external module loading corrected + hostpage select all avaliable on block selection --- app/module_loader.py | 13 ++++++++++--- static/js/controllers/hostPageCtrl.js | 23 +++++++++++++++-------- views/hostpage.html | 2 ++ 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/app/module_loader.py b/app/module_loader.py index 0d43201..57bc377 100644 --- a/app/module_loader.py +++ b/app/module_loader.py @@ -232,13 +232,20 @@ class ModuleLoader: else: # otherwise, load the external module normally try: part = getattr(loaded_mod, 'part') + if part not in self.loaded_mod_moni: + self.loaded_mod_moni[part] = {} + self.loaded_mod_moni[part]['compatible_os'] = [] + self.loaded_mod_moni[part]['compatible_conn'] = [] + self.loaded_mod_moni[part]['modules'] = {} if mod_name not in self.loaded_mod_moni[part]['modules']: self.loaded_mod_moni[part]['modules'][mod_name] = {} self.loaded_mod_moni[part]['modules'][mod_name]['imported'] = loaded_mod - self.loaded_mod_moni[part]['compatible_os'] = \ - list(set(self.loaded_mod_moni[part]['compatible_os'] + - getattr(loaded_mod, 'compatible_os'))) self.loaded_mod_moni[part]['modules'][mod_name]['external'] = True + self.loaded_mod_moni[part]['compatible_os'] = \ + list(set(self.loaded_mod_moni[part]['compatible_os'] + getattr(loaded_mod, 'compatible_os'))) + self.loaded_mod_moni[part]['compatible_conn'].append(getattr(loaded_mod, 'connection')) + self.loaded_mod_moni[part]['compatible_conn'] = \ + list(set(self.loaded_mod_moni[part]['compatible_conn'])) except AttributeError: print "Error : external monitoring module " + mod_name + " could not have been loaded. " diff --git a/static/js/controllers/hostPageCtrl.js b/static/js/controllers/hostPageCtrl.js index 348f781..a2077fd 100644 --- a/static/js/controllers/hostPageCtrl.js +++ b/static/js/controllers/hostPageCtrl.js @@ -470,7 +470,7 @@ mumApp.controller('ModalConfConnInstanceCtrl', function ($scope, $rootScope, $mo }; }); -mumApp.controller('ModalBlockInstanceCtrl', function ($scope, $rootScope, $modalInstance, $route, block_args) { +mumApp.controller('ModalBlockInstanceCtrl', function ($scope, $rootScope, $modalInstance, $route, $timeout, block_args) { $scope.block_args = block_args; /* {'addr_host': val, 'activated_mod':{ mod_name: bool @@ -483,7 +483,8 @@ mumApp.controller('ModalBlockInstanceCtrl', function ($scope, $rootScope, $modal 'compatible_os': [val1, val2, ...], => a list containing the compatibles os 'unit': val, => the unit type of return ('%', 'bool' or other) 'block': val, => the monitoring block of the module - 'part':val => the part checked by the moni mod + 'part':val, => the part checked by the moni mod + 'compatible_conn': [val1, val2, ...] => a list containing the compatibles connection modules } } } @@ -515,15 +516,21 @@ mumApp.controller('ModalBlockInstanceCtrl', function ($scope, $rootScope, $modal } $scope.select_all = function(block){ - for(mod in block){ - mod.activated = true; - } + $timeout(function() { // to prevent "inprog" angular error + for(var i=0; i<block.length; i++){ + if(!$scope.is_not_compatible(block[i].modname)){ + block[i].activated = true; + } + } + }, 0); }; $scope.select_none = function(block){ - for(mod in block){ - mod.activated = false; - } + $timeout(function() { // to prevent "inprog" angular error + for(var i=0; i<block.length; i++){ + block[i].activated = false; + } + }, 0); }; $scope.is_not_compatible = function(modname){ diff --git a/views/hostpage.html b/views/hostpage.html index a737f66..ce5b837 100644 --- a/views/hostpage.html +++ b/views/hostpage.html @@ -300,6 +300,7 @@ <button type="button" class="btn" ng-click="select_none(block)">Select none</button> </th> <th>Compatible Connections</th> + <th>Compatible OS</th> </tr> <tr ng-repeat-end ng-repeat="mod in block"> @@ -308,6 +309,7 @@ ng-model="mod.activated" ng-disabled="is_not_compatible(mod.modname)"></td> <td>{{block_args.loaded_moni_mod[mod.modname].compatible_conn}}</td> + <td>{{block_args.loaded_moni_mod[mod.modname].compatible_os}}</td> </tr> </table> </div> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository mum. See http://git.chorem.org/mum.git commit 4727ac1ba63db144afc20b3e14e35db75ba2b6fb Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Apr 17 15:27:01 2015 +0200 changed all asynchronous $scope.$apply on js to $timeout in order to prevent "inprog" angular errors --- static/js/controllers/hostPageCtrl.js | 32 +++++++++++++++--------------- static/js/controllers/notificationsCtrl.js | 20 +++++++++---------- static/js/controllers/profileCtrl.js | 16 +++++++-------- static/js/controllers/settingsCtrl.js | 6 +++--- static/js/controllers/usersCtrl.js | 10 +++++----- views/settings.html | 4 ++-- 6 files changed, 44 insertions(+), 44 deletions(-) diff --git a/static/js/controllers/hostPageCtrl.js b/static/js/controllers/hostPageCtrl.js index a2077fd..8a86c2a 100644 --- a/static/js/controllers/hostPageCtrl.js +++ b/static/js/controllers/hostPageCtrl.js @@ -1,4 +1,4 @@ -mumApp.controller('hostPageCtrl', function($scope, $rootScope, $route, $routeParams, $location, $modal) { +mumApp.controller('hostPageCtrl', function($scope, $rootScope, $route, $routeParams, $location, $modal, $timeout) { $scope.loaded = false; // indicates if this is the first loading of the page @@ -107,7 +107,7 @@ mumApp.controller('hostPageCtrl', function($scope, $rootScope, $route, $routePar // receiving the host informations $scope.$on("hostInfos", function (event, args) { - $scope.$apply(function(){ + $timeout(function() { if(!$scope.loaded){ // we take all the fields of information $scope.items = args; $scope.model.custom_infos = args.custom_infos; @@ -118,7 +118,7 @@ mumApp.controller('hostPageCtrl', function($scope, $rootScope, $route, $routePar $scope.items.monitoring = args.monitoring; $scope.items.status = args.status; } - }); + }, 0); }); // refresh after full detection @@ -134,10 +134,10 @@ mumApp.controller('hostPageCtrl', function($scope, $rootScope, $route, $routePar }); $scope.$on("remHost", function (event, args) { - $scope.$apply(function(){ + $timeout(function() { $rootScope.$broadcast("sendViaWs", JSON.stringify({"GET_HOSTS": ""})); $location.path('/'); - }); + }, 0); }); // save custom informations @@ -210,7 +210,7 @@ mumApp.controller('hostPageCtrl', function($scope, $rootScope, $route, $routePar // modals controllers -mumApp.controller('ModalConfInstanceCtrl', function ($scope, $rootScope, $modalInstance, $route, conf_args) { +mumApp.controller('ModalConfInstanceCtrl', function ($scope, $rootScope, $modalInstance, $route, $timeout, conf_args) { $scope.conf_args = conf_args; // {'addr_host' : val, 'mod_name', val} $rootScope.$broadcast("sendViaWs", JSON.stringify({"CALL_FUNC_DB": {'func': 'get_conf_mod', 'args': conf_args}})); @@ -239,7 +239,7 @@ mumApp.controller('ModalConfInstanceCtrl', function ($scope, $rootScope, $modalI // when the actual conf of the module is received $scope.$on("resCall", function (event, args) { if(args.func == 'get_conf_mod'){ - $scope.$apply(function(){ + $timeout(function() { $scope.items = args.res; $scope.freq_days = Math.floor(args.res.freq / 86400); $scope.freq_hours = Math.floor((args.res.freq - $scope.freq_days * 86400) / 3600); @@ -258,7 +258,7 @@ mumApp.controller('ModalConfInstanceCtrl', function ($scope, $rootScope, $modalI $scope.minor_limit_unit = args.res.minor_limit; $scope.major_limit_unit = args.res.major_limit; } - }); + }, 0); } }); @@ -321,7 +321,7 @@ mumApp.controller('ModalIntervInstanceCtrl', function ($scope, $rootScope, $moda }; }); -mumApp.controller('ModalConnInstanceCtrl', function ($scope, $rootScope, $modalInstance, $modal, $route, conn_args) { +mumApp.controller('ModalConnInstanceCtrl', function ($scope, $rootScope, $modalInstance, $modal, $route, $timeout, conn_args) { $scope.conn_args = conn_args; // {'addr_host' : val} $scope.current_config = {}; @@ -343,12 +343,12 @@ mumApp.controller('ModalConnInstanceCtrl', function ($scope, $rootScope, $modalI // when the configuration of the connection is received $scope.$on("resCall", function (event, args) { if(args.func == 'get_conn_param'){ - $scope.$apply(function(){ + $timeout(function() { $scope.current_config = args.res; for(mod in args.res){ $scope.priorities[mod] = args.res[mod]['priority'] } - }); + }, 0); $rootScope.$broadcast("sendViaWs", JSON.stringify({"GET_LOADED_CONN_MOD": ""})); } if(args.func == 'set_prio_conn'){ @@ -358,7 +358,7 @@ mumApp.controller('ModalConnInstanceCtrl', function ($scope, $rootScope, $modalI }); $scope.$on("resGetLoadedConnMod", function (event, args) { - $scope.$apply(function(){ + $timeout(function() { $scope.loaded_conn_mods = args; for(mod in $scope.loaded_conn_mods){ if(!$scope.current_config.hasOwnProperty(mod)){ @@ -366,7 +366,7 @@ mumApp.controller('ModalConnInstanceCtrl', function ($scope, $rootScope, $modalI $scope.current_config[mod]['priority'] = 0; } } - }); + }, 0); }); $scope.testConn = function(connModName){ @@ -405,7 +405,7 @@ mumApp.controller('ModalConnInstanceCtrl', function ($scope, $rootScope, $modalI }; }); -mumApp.controller('ModalConfConnInstanceCtrl', function ($scope, $rootScope, $modalInstance, $route, conf_conn_args, FileUploader) { +mumApp.controller('ModalConfConnInstanceCtrl', function ($scope, $rootScope, $modalInstance, $route, $timeout, conf_conn_args, FileUploader) { $scope.uploader = new FileUploader({ url: '/upload' }); @@ -439,9 +439,9 @@ mumApp.controller('ModalConfConnInstanceCtrl', function ($scope, $rootScope, $mo $rootScope.$broadcast("sendViaWs", JSON.stringify({"GET_KEYS_LIST": ""})); $scope.$on("keysList", function (event, args) { - $scope.$apply(function(){ + $timeout(function() { $scope.keys_list = args; - }); + }, 0); }); $scope.$on("resCall", function (event, args) { diff --git a/static/js/controllers/notificationsCtrl.js b/static/js/controllers/notificationsCtrl.js index dc85a7e..0a24ed3 100644 --- a/static/js/controllers/notificationsCtrl.js +++ b/static/js/controllers/notificationsCtrl.js @@ -1,4 +1,4 @@ -mumApp.controller('notificationsCtrl', function($scope, $rootScope, $modal, $route, DataHosts) { +mumApp.controller('notificationsCtrl', function($scope, $rootScope, $modal, $route, $timeout, DataHosts) { $scope.items = DataHosts.Items; /* [ { "addr":"192.168.74.1", @@ -26,16 +26,16 @@ mumApp.controller('notificationsCtrl', function($scope, $rootScope, $modal, $rou $rootScope.$broadcast("sendViaWs", JSON.stringify({"GET_ALL_SUBSCRIPTIONS": ""})); $scope.$on("resGetAllSubscriptions", function (event, args) { - $scope.$apply(function(){ + $timeout(function() { $scope.all_subscriptions = args; - }); + }, 0); $rootScope.$broadcast("sendViaWs", JSON.stringify({"GET_LOADED_NOTIF_MOD": ""})); }); $scope.$on("resGetLoadedNotifMod", function (event, args) { - $scope.$apply(function(){ + $timeout(function() { $scope.notif_mods = args; - }); + }, 0); }); $scope.subscriber_data = {}; /* {username:{"minor":{mod_notif:{"activated":bool,"priority":int}, ...}, @@ -109,7 +109,7 @@ mumApp.controller('notificationsCtrl', function($scope, $rootScope, $modal, $rou ... }}} */ if(args.func == 'get_host_subscribers' || args.func == 'get_group_subscribers'){ - $scope.$apply(function(){ + $timeout(function() { var sd = {}; for(user in args.res){ sd[user] = {}; @@ -132,7 +132,7 @@ mumApp.controller('notificationsCtrl', function($scope, $rootScope, $modal, $rou } $scope.subscriber_data = sd; $scope.subscriber_data_unchanged = sd; - }); + }, 0); } if(args.func == 'update_subscription_to_group' || args.func == 'update_subscription_to_host'){ $route.reload(); @@ -186,7 +186,7 @@ mumApp.controller('notificationsCtrl', function($scope, $rootScope, $modal, $rou }; }); -mumApp.controller('ModalAddSubscriberInstanceCtrl', function ($scope, $rootScope, $modalInstance, $route, add_subscriber_args) { +mumApp.controller('ModalAddSubscriberInstanceCtrl', function ($scope, $rootScope, $modalInstance, $route, $timeout, add_subscriber_args) { $scope.add_subscriber_args = add_subscriber_args; /* {'grp': val, 'host': val */ $scope.modal_title = "Add users to "; @@ -206,9 +206,9 @@ mumApp.controller('ModalAddSubscriberInstanceCtrl', function ($scope, $rootScope // receiving the user list $scope.$on("resCall", function (event, args) { if(args.func == 'get_users'){ - $scope.$apply(function(){ + $timeout(function() { $scope.users = args.res; - }); + }, 0); } if(args.func == 'subscribe_to_group' || args.func == 'subscribe_to_host'){ diff --git a/static/js/controllers/profileCtrl.js b/static/js/controllers/profileCtrl.js index 1fc49e2..24b0d94 100644 --- a/static/js/controllers/profileCtrl.js +++ b/static/js/controllers/profileCtrl.js @@ -1,4 +1,4 @@ -mumApp.controller('profileCtrl', function($scope, $rootScope, $route, $modal){ +mumApp.controller('profileCtrl', function($scope, $rootScope, $route, $modal, $timeout){ $scope.users = {}; @@ -12,15 +12,15 @@ mumApp.controller('profileCtrl', function($scope, $rootScope, $route, $modal){ // after calling db functions $scope.$on("resCall", function (event, args) { if(args.func == 'get_users'){ - $scope.$apply(function(){ + $timeout(function() { $scope.users = args.res; - }); + }, 0); } if(args.func == 'get_user_settings'){ - $scope.$apply(function(){ + $timeout(function() { $scope.email = args.res.settings.email; $scope.sms_url = args.res.settings.sms_url; - }); + }, 0); } if(args.func == 'update_user_settings'){ $route.reload(); @@ -60,7 +60,7 @@ mumApp.controller('profileCtrl', function($scope, $rootScope, $route, $modal){ }; }); -mumApp.controller('ModalSubscriptionsInstanceCtrl', function ($scope, $rootScope, $modalInstance, subs_args) { +mumApp.controller('ModalSubscriptionsInstanceCtrl', function ($scope, $rootScope, $modalInstance, $timeout, subs_args) { $scope.subs_args = subs_args; // { 'username': string } $scope.user_subscriptions = {}; /* @@ -85,9 +85,9 @@ mumApp.controller('ModalSubscriptionsInstanceCtrl', function ($scope, $rootScope $scope.$on("resCall", function (event, args) { if(args.func == 'get_user_subscriptions'){ - $scope.$apply(function(){ + $timeout(function() { $scope.user_subscriptions = args.res; - }); + }, 0); } }); diff --git a/static/js/controllers/settingsCtrl.js b/static/js/controllers/settingsCtrl.js index 6e06a8f..3c5fdb2 100644 --- a/static/js/controllers/settingsCtrl.js +++ b/static/js/controllers/settingsCtrl.js @@ -1,13 +1,13 @@ -mumApp.controller('settingsCtrl', function($scope, $rootScope, $modal) { +mumApp.controller('settingsCtrl', function($scope, $rootScope, $modal, $timeout) { $scope.settings = {}; // { mod_name: {'check_frequency': 60, 'minor_limit': True, 'activated': False, 'major_limit': False, 'block': 'software', 'unit': 'bool'}} $rootScope.$broadcast("sendViaWs", JSON.stringify({"CALL_FUNC_DB": {'func': 'get_global_settings','args': null}})); $scope.$on("resCall", function (event, args) { if(args.func == 'get_global_settings'){ - $scope.$apply(function(){ + $timeout(function() { $scope.settings = args.res; - }); + }, 0); } }); diff --git a/static/js/controllers/usersCtrl.js b/static/js/controllers/usersCtrl.js index 5abc4a3..2f61e47 100644 --- a/static/js/controllers/usersCtrl.js +++ b/static/js/controllers/usersCtrl.js @@ -1,4 +1,4 @@ -mumApp.controller('usersCtrl', function($scope, $rootScope, $route) { +mumApp.controller('usersCtrl', function($scope, $rootScope, $route, $timeout) { $scope.users = {}; $scope.selected_user = ""; @@ -29,17 +29,17 @@ mumApp.controller('usersCtrl', function($scope, $rootScope, $route) { // receiving the user list $scope.$on("resCall", function (event, args) { if(args.func == 'get_users'){ - $scope.$apply(function(){ + $timeout(function() { $scope.users = args.res; - }); + }, 0); } if(args.func == 'create_user' || args.func == 'remove_user'){ $route.reload(); } if(args.func == 'get_user_subscriptions'){ - $scope.$apply(function(){ + $timeout(function() { $scope.user_subscriptions = args.res; - }); + }, 0); } }); diff --git a/views/settings.html b/views/settings.html index 9428423..a0c06b7 100644 --- a/views/settings.html +++ b/views/settings.html @@ -58,10 +58,10 @@ </div> </div> <div ng-show="global_conf_args.conf_mod.unit != '%' && global_conf_args.conf_mod.unit != 'bool'"> - <label for="minor_unit">Minor notif at {{minor_limit_unit}}</label> + <label for="minor_unit">Minor notif at {{minor_limit_unit}} {{global_conf_args.conf_mod.unit}}</label> <input type="number" class="form-control" id="minor_unit" min="0" ng-model="minor_limit_unit"> - <label for="maj_pack">Major notif at {{major_limit_unit}}</label> + <label for="maj_pack">Major notif at {{major_limit_unit}} {{global_conf_args.conf_mod.unit}}</label> <input type="number" class="form-control" id="maj_pack" min="0" ng-model="major_limit_unit"> </div> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository mum. See http://git.chorem.org/mum.git commit e25ed006647ff08540ccbe37353d4224695608cb Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Apr 17 16:15:03 2015 +0200 handled exceptions on module loader + print traceback + bug fix on full detection --- app/module_loader.py | 26 ++++++++++++++++++++------ app/mum.py | 7 +++++-- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/app/module_loader.py b/app/module_loader.py index 57bc377..eb95f05 100644 --- a/app/module_loader.py +++ b/app/module_loader.py @@ -16,6 +16,7 @@ import re import pkgutil import sys import os +import traceback class ModuleLoader: @@ -165,7 +166,8 @@ class ModuleLoader: self.compatible_os_list.append(os) self.loaded_mod_detect[mod_name] = infos_mod except AttributeError: - print "Error : internal detection module " + mod_name + " could not have been loaded. " + print "Error : internal detection module " + mod_name + " could not have been loaded. Traceback:" + print traceback.format_exc() def run_all_detection_modules(self, addr_host): """ @@ -174,6 +176,7 @@ class ModuleLoader: """ db = self.get_db() conf_conn = self.db.get_conf_conn(addr_host) + success_detection = False for mod_name in self.loaded_mod_detect: for i in range(len(conf_conn)): if self.loaded_mod_detect[mod_name]['compatible_conn'] == conf_conn[i]['conn_mod_name']: @@ -181,10 +184,15 @@ class ModuleLoader: conn_inst = self.create_connection(addr_host, conf_conn[i]) getattr(self.loaded_mod_detect[mod_name]['imported'], 'run_detection')(conn_inst, db) + success_detection = True except modules.ModuleNotCompatibleException.ModuleNotCompatibleException as mnce: print mnce.__str__() except modules.CommandNotFoundException.CommandNotFoundException as cnfe: print cnfe.__str__() + except Exception: + print "An unexpected error occured during the full detection of " + addr_host + ". Traceback:" + print traceback.format_exc() + return success_detection def load_all_monitoring_modules(self): """ @@ -213,7 +221,8 @@ class ModuleLoader: list(set(self.loaded_mod_moni[part]['compatible_conn'])) all_internal_mod[mod_name] = part except AttributeError: - print "Error : internal monitoring module " + mod_name + " could not have been loaded. " + print "Error : internal monitoring module " + mod_name + " could not have been loaded. Traceback:" + print traceback.format_exc() # Now for external modules: if self.conf['external_modules_location'] is not None: @@ -247,7 +256,8 @@ class ModuleLoader: self.loaded_mod_moni[part]['compatible_conn'] = \ list(set(self.loaded_mod_moni[part]['compatible_conn'])) except AttributeError: - print "Error : external monitoring module " + mod_name + " could not have been loaded. " + print "Error : external monitoring module " + mod_name + " could not have been loaded. Traceback:" + print traceback.format_exc() def run_one_monitoring_module(self, part_name, addr_host, conn, db): """ @@ -299,7 +309,8 @@ class ModuleLoader: self.db.config_mod_activation(dict_deactivation_request) except Exception: print "Monitoring module " + part_name + " have been disabled on " + addr_host + \ - " because of an unexpected error." + " because of an unexpected error. Traceback:" + print traceback.format_exc() process_monitoring.remove_to_waiting_list(addr_host, part_name) dict_deactivation_request = {} dict_deactivation_request['addr_host'] = addr_host @@ -377,7 +388,8 @@ class ModuleLoader: infos_mod['known_port'] = getattr(mod_inst, 'get_known_port')() self.loaded_mod_conn[mod_name] = infos_mod except AttributeError: - print "Error : internal connection module " + mod_name + " could not have been loaded. " + print "Error : internal connection module " + mod_name + " could not have been loaded. Traceback:" + print traceback.format_exc() def get_conection_modules_list(self): """ @@ -432,7 +444,8 @@ class ModuleLoader: infos_mod['class_name'] = getattr(mod_inst, 'get_name')() self.loaded_mod_notif[mod_name] = infos_mod except AttributeError: - print "Error : internal notification module " + mod_name + " could not have been loaded. " + print "Error : internal notification module " + mod_name + " could not have been loaded. Traceback:" + print traceback.format_exc() def get_info_mod_notification(self): """ @@ -474,6 +487,7 @@ class ModuleLoader: mod_inst.notify() except KeyError: print 'Missing setting for notification module ' + notif_mod + print traceback.format_exc() def update_global_conf(self): """ diff --git a/app/mum.py b/app/mum.py index 016306f..dc79af3 100755 --- a/app/mum.py +++ b/app/mum.py @@ -131,8 +131,11 @@ def receive(ws): ml.create_empty_host(msg["CREATE_EMPTY_HOST"]) ws.send(json.dumps({"SUCCESS_MODULE": "Creation of new host"})) elif code == "LAUNCH_FULL_DETECTION": # asked from hostpage - ml.run_all_detection_modules(msg["LAUNCH_FULL_DETECTION"]) - ws.send(json.dumps({"SUCCESS_MODULE": "Full detection"})) + suceess_detection = ml.run_all_detection_modules(msg["LAUNCH_FULL_DETECTION"]) + if suceess_detection: + ws.send(json.dumps({"SUCCESS_MODULE": "Full detection"})) + else: + ws.send(json.dumps({"ERROR": "Full detection has failed (is SSH well configured?)"})) elif code == "GET_HOSTS": # asked from head controller db = ml.get_db() ws.send(json.dumps({"RES_GET_HOSTS": db.get_hosts()})) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm