diff options
-rw-r--r-- | swift/1.4.8/plugins/DiskDir.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/swift/1.4.8/plugins/DiskDir.py b/swift/1.4.8/plugins/DiskDir.py index e0d5eb77756..a9e39fd4c4f 100644 --- a/swift/1.4.8/plugins/DiskDir.py +++ b/swift/1.4.8/plugins/DiskDir.py @@ -411,8 +411,13 @@ class DiskDir(DiskCommon): self.unlink() def update_metadata(self, metadata): - self.metadata.update(metadata) - write_metadata(self.datadir, self.metadata) + assert self.metadata, "Valid container/account metadata should have been created by now" + if metadata: + new_metadata = self.metadata.copy() + new_metadata.update(metadata) + if new_metadata != self.metadata: + write_metadata(self.datadir, new_metadata) + self.metadata = new_metadata class DiskAccount(DiskDir): |