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 a8438f1caec62e5117607d1617b6a2c041cdf3c0 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Mar 27 11:44:19 2015 +0100 regex utilisée pour sms_url --- app/modules/notification_modules/sms_notif.py | 3 +- app/modules/storage_modules/shelve_db.py | 8 ++--- views/profile.html | 49 +-------------------------- 3 files changed, 7 insertions(+), 53 deletions(-) diff --git a/app/modules/notification_modules/sms_notif.py b/app/modules/notification_modules/sms_notif.py index b20438f..1ddad7c 100644 --- a/app/modules/notification_modules/sms_notif.py +++ b/app/modules/notification_modules/sms_notif.py @@ -1,6 +1,7 @@ __author__ = 'aguilbaud' import urllib2 +import re def get_class_name(): return "SMS" @@ -18,7 +19,7 @@ class SMS: return self.name def notify(self): - url = self.user_data['sms_url'] + self.msg + url = re.sub(r'#message#', self.msg, self.user_data['sms_url']) req = urllib2.Request(url) try: diff --git a/app/modules/storage_modules/shelve_db.py b/app/modules/storage_modules/shelve_db.py index 083e7c4..42aac7a 100644 --- a/app/modules/storage_modules/shelve_db.py +++ b/app/modules/storage_modules/shelve_db.py @@ -773,8 +773,8 @@ class shelve_db: ... } """ - title = "[Mum] " + status + " on " + addr_host - msg = "Mum repported a " + status + " value by the " + moni_mod + " mod " + title = "[Mum] " + status + " for " + addr_host + msg = "Mum repported a " + status + " value from the " + moni_mod + " module. " dict_notif = {} notif_type = "" if status == 'warning': @@ -803,7 +803,7 @@ class shelve_db: if param_notif['activated']: title = "[Mum] " + status + " for " + addr_host + " on group " + group msg = "Mum repported a " + status + " from the " + moni_mod + " module on host " + \ - addr_host + " member of group " + group + addr_host + " member of group " + group + "." if notif_mod not in dict_notif: dict_notif[notif_mod] = [] dict_notif[notif_mod].append({'user': self.db['users'][username]['settings'], @@ -1029,7 +1029,7 @@ class shelve_db: """ self.open_db() try: - self.db['users'][args['user']]['settings'] = args['settings'] + self.db['users'][args['username']]['settings'] = args['settings'] except Exception: print traceback.format_exc() finally: diff --git a/views/profile.html b/views/profile.html index 39b8411..d3d5f94 100644 --- a/views/profile.html +++ b/views/profile.html @@ -35,7 +35,7 @@ </div> <div class="row"></div> <div class="col-xs-8"> - <label for="cellphone">SMS URL</label> + <label for="cellphone">SMS URL (put #message# on the message parameter)</label> <input type="text" class="form-control" id="cellphone" ng-model="sms_url"> </div> </div> @@ -142,51 +142,4 @@ <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="close()">Close</button> </div> </script> - <!--<h3>Summary of notification subscriptions</h3> - <p>Number of notifications between your last login</p> - <table class="table table-hover"> - <thead> - <tr> - <th>Host/Group</th> - <th>Notification service</th> - <th>Minor</th> - <th>Major</th> - </tr> - </thead> - <tbody> - <tr> - <td rowspan="2">mygroup2</td> - <td>Browser</td> - <td class="success">1</td> - <td class="success">1</td> - </tr> - <tr> - <td>E-mail</td> - <td></td> - <td class="success">3</td> - </tr> - <tr> - <td>142.42.13.37</td> - <td>E-mail</td> - <td class="success">3</td> - <td class="success">1</td> - </tr> - <tr> - <td rowspan="3">192.168.74.1</td> - <td>Browser</td> - <td class="success">1</td> - <td class="success">1</td> - </tr> - <tr> - <td>E-mail</td> - <td></td> - <td class="success">3</td> - </tr> - <tr> - <td>SMS</td> - <td></td> - <td class="success">5</td> - </tr> - </tbody> - </table>--> </div> \ No newline at end of file -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.