AlchemyBackend do db insert or replace in policy_set and attribute_copy
authorSofia Papagiannaki <papagian@gmail.com>
Thu, 8 Sep 2011 12:44:04 +0000 (15:44 +0300)
committerSofia Papagiannaki <papagian@gmail.com>
Thu, 8 Sep 2011 12:44:04 +0000 (15:44 +0300)
pithos/backends/lib_alchemy/node.py
pithos/backends/lib_alchemy/policy.py

index 6e7c887..7bd5210 100644 (file)
@@ -654,6 +654,7 @@ class Node(DBWorker):
         attributes = rp.fetchall()
         rp.close()
         for dest, k, v in attributes:
+            #insert or replace
             s = self.attributes.update().where(and_(
                 self.attributes.c.serial == dest,
                 self.attributes.c.key == k))
index 203bc7d..66ff9fa 100644 (file)
@@ -52,6 +52,7 @@ class Policy(DBWorker):
         metadata.bind = self.engine
     
     def policy_set(self, path, policy):
+        #insert or replace
         for k, v in policy.iteritems():
             s = self.policies.update().where(and_(self.policies.c.path == path,
                                                   self.policies.c.key == k))