Import directly from the inside of the ring module

An odd thing happened: when my code did only
"from swift.common.ring import Ring", and nothing else,
the interpreter looped on the CPU.

The import from the top of the ring module is our standard
protocol for Ring. It causes no problem in places like
container updater or list_endpoints.py. It is a big
mystery why it causes Python 3.7.3 to loop, and only
in specific circumstances.

But we noticed that the recursive import is unnecesasry
in this case, so an obviously harmless fix exists.

Change-Id: I7373bbb0a50d090d6becf141e5832f8ae98381a4
This commit is contained in:
Pete Zaitcev 2020-01-03 18:34:11 -06:00
parent f73a190837
commit 0f13db30b6
1 changed files with 1 additions and 1 deletions

View File

@ -33,7 +33,7 @@ from six.moves import range
from time import time
from swift.common import exceptions
from swift.common.ring import RingData
from swift.common.ring.ring import RingData
from swift.common.ring.utils import tiers_for_dev, build_tier_tree, \
validate_and_normalize_address, validate_replicas_by_tier, pretty_dev