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. Change-Id: Icdf100dfcd006d975b49d151b99aa9272452d013
This commit is contained in:
parent
1f7b97ec0f
commit
40edf07ab3
@ -158,6 +158,7 @@ All three steps may be performed with one sub-command::
|
|||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
import argparse
|
import argparse
|
||||||
import json
|
import json
|
||||||
|
import os.path
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
@ -513,8 +514,8 @@ def main(args=None):
|
|||||||
print('\nA sub-command is required.')
|
print('\nA sub-command is required.')
|
||||||
return 1
|
return 1
|
||||||
logger = get_logger({}, name='ContainerBroker', log_to_console=True)
|
logger = get_logger({}, name='ContainerBroker', log_to_console=True)
|
||||||
broker = ContainerBroker(args.container_db, logger=logger,
|
broker = ContainerBroker(os.path.realpath(args.container_db),
|
||||||
skip_commits=True)
|
logger=logger, skip_commits=True)
|
||||||
try:
|
try:
|
||||||
broker.get_info()
|
broker.get_info()
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
|
Loading…
Reference in New Issue
Block a user