comparison src/memory/sqlite.py @ 1047:5f7f913c05ac

memory: synchronize the upgrade to database v2 to be sure libervia's profile password is read to be written in the config file before its encryption
author souliane <souliane@mailoo.org>
date Fri, 23 May 2014 13:00:35 +0200
parents 65fffdcb97f1
children 9378c80e3408
comparison
equal deleted inserted replaced
1046:a874a79ad0f5 1047:5f7f913c05ac
811 except IndexError: 811 except IndexError:
812 log.error("Libervia profile exists but no password is set! Update Libervia configuration will be skipped.") 812 log.error("Libervia profile exists but no password is set! Update Libervia configuration will be skipped.")
813 return 813 return
814 fixConfigOption('libervia', 'passphrase', password, False) 814 fixConfigOption('libervia', 'passphrase', password, False)
815 d = self.dbpool.runQuery("SELECT value FROM param_ind WHERE category=? AND name=? AND profile_id=?", xmpp_pass_path + (profile_id,)) 815 d = self.dbpool.runQuery("SELECT value FROM param_ind WHERE category=? AND name=? AND profile_id=?", xmpp_pass_path + (profile_id,))
816 d.addCallback(cb) 816 return d.addCallback(cb)
817 817
818 d = self.dbpool.runQuery("SELECT id FROM profiles WHERE name='libervia'") 818 d = self.dbpool.runQuery("SELECT id FROM profiles WHERE name='libervia'")
819 d.addCallback(updateLiberviaConf) 819 d.addCallback(updateLiberviaConf)
820 820 d.addCallback(lambda dummy: self.dbpool.runQuery("SELECT profile_id,value FROM param_ind WHERE category=? AND name=?", xmpp_pass_path))
821 d = self.dbpool.runQuery("SELECT profile_id,value FROM param_ind WHERE category=? AND name=?", xmpp_pass_path)
822 d.addCallback(encrypt_values) 821 d.addCallback(encrypt_values)
823 return d 822 return d