summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Burke <tim.burke@gmail.com>2019-12-20 21:36:07 +0000
committerPete Zaitcev <zaitcev@kotori.zaitcev.us>2021-02-05 20:23:57 -0600
commite828b37cae90cc6da451f931b18cbabcd5558ad0 (patch)
treefe091a864ea62728566cebb5459f96d942c3e312
parent2a6ffd33fbc9aa8fb0d0d45063c4701810c70bd4 (diff)
downloadswift-e828b37cae90cc6da451f931b18cbabcd5558ad0.tar.gz
sharding: Let swift-manage-shard-ranges accept a relative path
Previously, passing a relative path would confuse the ContainerBroker about which DB files are available, leading to an IndexError when none were found. Just call realpath() on whatever the user provided so we don't have to muck with any of the broker code. Cherry-Picked-From: Icdf100dfcd006d975b49d151b99aa9272452d013 Change-Id: I77d3b50b802208732a11c68a2e77ceba7339dda0
-rw-r--r--swift/cli/manage_shard_ranges.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/swift/cli/manage_shard_ranges.py b/swift/cli/manage_shard_ranges.py
index 6e0fb3897..667304d57 100644
--- a/swift/cli/manage_shard_ranges.py
+++ b/swift/cli/manage_shard_ranges.py
@@ -158,6 +158,7 @@ All three steps may be performed with one sub-command::
from __future__ import print_function
import argparse
import json
+import os.path
import sys
import time
@@ -513,8 +514,8 @@ def main(args=None):
print('\nA sub-command is required.')
return 1
logger = get_logger({}, name='ContainerBroker', log_to_console=True)
- broker = ContainerBroker(args.container_db, logger=logger,
- skip_commits=True)
+ broker = ContainerBroker(os.path.realpath(args.container_db),
+ logger=logger, skip_commits=True)
try:
broker.get_info()
except Exception as exc: