Skip to content

Commit 0349fd3

Browse files
authored
CE-579 Couchbase 1.30 >> Upgrade Logic >> KeyError while upgrading plugin (#65)
PR URL: https://www.github.com/delphix/couchbase-plugin/pull/65
1 parent f36c9d9 commit 0349fd3

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

src/plugin_runner.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,29 +32,33 @@
3232

3333
@plugin.upgrade.linked_source("2023.10.27.01")
3434
def update_bucket_size(old_linked_source):
35+
logger.debug(f"Started upgrade update_bucket_size:{old_linked_source}")
3536
old_linked_source = dict(old_linked_source)
36-
if isinstance(old_linked_source["bucket_size"], int):
37-
if old_linked_source["bucket_size"] == 0:
38-
old_linked_source["bucket_size"] = []
37+
if isinstance(old_linked_source["bucketSize"], int):
38+
if old_linked_source["bucketSize"] == 0:
39+
old_linked_source["bucketSize"] = []
3940
else:
40-
d = [{"bname": "*", "bsize": old_linked_source["bucket_size"]}]
41-
old_linked_source["bucket_size"] = d
41+
d = [{"bname": "*", "bsize": old_linked_source["bucketSize"]}]
42+
old_linked_source["bucketSize"] = d
43+
logger.debug(f"Completed update_bucket_size: {old_linked_source}")
4244
return old_linked_source
4345

4446

4547
@plugin.upgrade.linked_source("2023.10.27.02")
4648
def update_archive_name(old_linked_source):
49+
logger.debug(f"Started upgrade update_archive_name:{old_linked_source}")
4750
old_linked_source = dict(old_linked_source)
48-
if "archive_name" not in old_linked_source.keys():
49-
if old_linked_source["couchbase_bak_loc"] == "":
50-
old_linked_source["archive_name"] = ""
51+
if "archiveName" not in old_linked_source.keys():
52+
if old_linked_source["couchbaseBakLoc"] == "":
53+
old_linked_source["archiveName"] = ""
5154
else:
52-
old_linked_source["archive_name"] = os.path.basename(
53-
old_linked_source["couchbase_bak_loc"]
55+
old_linked_source["archiveName"] = os.path.basename(
56+
old_linked_source["couchbaseBakLoc"]
5457
)
55-
old_linked_source["couchbase_bak_loc"] = os.path.dirname(
56-
old_linked_source["couchbase_bak_loc"]
58+
old_linked_source["couchbaseBakLoc"] = os.path.dirname(
59+
old_linked_source["couchbaseBakLoc"]
5760
)
61+
logger.debug(f"Completed update_archive_name: {old_linked_source}")
5862
return old_linked_source
5963

6064

0 commit comments

Comments
 (0)