Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding multi-bucket support for cbbackup #13

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions pump.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,17 @@ def filter_source_buckets(self, source_map):
logging.debug("source_buckets: " +
",".join([n['name'] for n in source_buckets]))

bucket_source = getattr(self.opts, "bucket_source", None)
if bucket_source:
logging.debug("bucket_source: " + bucket_source)
source_buckets = [b for b in source_buckets
if b['name'] == bucket_source]
buckets_source = set(getattr(self.opts, "bucket_source", []))
if buckets_source:
buckets_source_list = []
for bucket_source in buckets_source:
logging.debug("bucket_source: " + bucket_source)
buckets_source_list.extend([b for b in source_buckets
if b['name'] == bucket_source])
source_buckets = buckets_source_list
logging.debug("source_buckets filtered: " +
",".join([n['name'] for n in source_buckets]))
",".join([n['name'] for n in source_buckets]))

return source_buckets

def filter_source_nodes(self, source_bucket, source_map):
Expand Down Expand Up @@ -1083,7 +1087,8 @@ def find_source_bucket_name(opts, source_map):
source_bucket = source_map['buckets'][0]['name']
if not source_bucket:
return "error: please specify a bucket_source", None
logging.debug("source_bucket: " + source_bucket)
for bucket in source_bucket:
logging.debug("source_bucket: " + bucket)
return 0, source_bucket

def find_sink_bucket_name(opts, source_bucket):
Expand Down
4 changes: 2 additions & 2 deletions pump_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,8 @@ def __init__(self):

def opt_parser_options(self, p):
p.add_option("-b", "--bucket-source",
action="store", type="string", default=None,
help="""single bucket from source to backup""")
action="append", type="string", default=[],
help="""single or multiple buckets from source to backup""")
p.add_option("", "--single-node",
action="store_true", default=False,
help="""use a single server node from the source only,
Expand Down