From dc9e6086c356857cfb180e01bebad7e5ea119e35 Mon Sep 17 00:00:00 2001 From: Sofia Papagiannaki Date: Thu, 8 Sep 2011 15:44:04 +0300 Subject: [PATCH] AlchemyBackend do db insert or replace in policy_set and attribute_copy --- pithos/backends/lib_alchemy/node.py | 1 + pithos/backends/lib_alchemy/policy.py | 1 + 2 files changed, 2 insertions(+) diff --git a/pithos/backends/lib_alchemy/node.py b/pithos/backends/lib_alchemy/node.py index 6e7c887..7bd5210 100644 --- a/pithos/backends/lib_alchemy/node.py +++ b/pithos/backends/lib_alchemy/node.py @@ -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)) diff --git a/pithos/backends/lib_alchemy/policy.py b/pithos/backends/lib_alchemy/policy.py index 203bc7d..66ff9fa 100644 --- a/pithos/backends/lib_alchemy/policy.py +++ b/pithos/backends/lib_alchemy/policy.py @@ -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)) -- 1.7.10.4