Esempio n. 1
0
 def handle(self, d):
     if d['type'] == 'unix':
         with self.unix_lock:
             set_unix_map(self, d['map'])
         # XXX decide where we will call this as this is a bit ugly
         with self.samba_lock:
             set_samba_map(self, d['map'])
     elif d['type'] == 'setpass':
         with self.unix_lock:
             unix_setpass(self, d['user'], d['pass'])
         with self.samba_lock:
             samba_setpass(self, d['user'], d['pass'])
         with self.wolk_lock:
             wolk_setpass(self, d['user'], d['pass'])
     elif d['type'] == 'fotoadmin-scan-userdirs':
         return fotoadmin_scan_userdirs()
     elif d['type'] == 'fotoadmin-remove-moved-fotos':
         with self.fotoadmin_lock:
             return fotoadmin_remove_moved_fotos(
                 self,
                 d['store'],
                 d['user'],
                 d['dir']
             )
     elif d['type'] == 'wolk':
         with self.wolk_lock:
             return apply_wolk_changes(self, d['changes'])
     else:
         logging.info('unknown command type: %s', repr(d['type']))
Esempio n. 2
0
 def handle(self, d):
     if d['type'] == 'unix':
         with self.unix_lock:
             set_unix_map(self, d['map'])
         # XXX decide where we will call this as this is a bit ugly
         with self.samba_lock:
             set_samba_map(self, d['map'])
     elif d['type'] == 'setpass':
         with self.unix_lock:
             unix_setpass(self, d['user'], d['pass'])
         with self.samba_lock:
             samba_setpass(self, d['user'], d['pass'])
     elif d['type'] == 'fotoadmin-remove-moved-fotos':
         with self.fotoadmin_lock:
             return fotoadmin_remove_moved_fotos(self,
                     d['user'], d['dir'])