Skip to content

Commit b439e61

Browse files
1 parent d954362 commit b439e61

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

src/plugin_runner.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#
55

66
import logging
7+
import os
78

89
from controller.couchbase_operation import CouchbaseOperation
910
from controller.helper_lib import check_server_is_used
@@ -29,6 +30,34 @@
2930
logger = logging.getLogger(__name__)
3031

3132

33+
@plugin.upgrade.linked_source("2023.10.27.01")
34+
def update_bucket_size(old_linked_source):
35+
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"] = []
39+
else:
40+
d = [{"bname": "*", "bsize": old_linked_source["bucket_size"]}]
41+
old_linked_source["bucket_size"] = d
42+
return old_linked_source
43+
44+
45+
@plugin.upgrade.linked_source("2023.10.27.02")
46+
def update_archive_name(old_linked_source):
47+
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+
else:
52+
old_linked_source["archive_name"] = os.path.basename(
53+
old_linked_source["couchbase_bak_loc"]
54+
)
55+
old_linked_source["couchbase_bak_loc"] = os.path.dirname(
56+
old_linked_source["couchbase_bak_loc"]
57+
)
58+
return old_linked_source
59+
60+
3261
#
3362
# Below is an example of the repository discovery operation.
3463
#

0 commit comments

Comments
 (0)