py3: Fix swift-dispersion-populate
We fixed swift-dispersion-report already; -populate needed the same fix or else it'd hit a "maximum recursion depth exceeded" error. Change-Id: I2d22e087a88c9e8003621feb26460ab6e5ce2a57 Related-Change: I24f4bcc3d62dc37fd9559032bfd25f5b15f98745 Closes-Bug: #1895346 Related-Bug: #1863680
This commit is contained in:
parent
4fefdf4d83
commit
5b8073c770
@ -27,10 +27,6 @@ import six
|
|||||||
from six.moves import range
|
from six.moves import range
|
||||||
from six.moves.configparser import ConfigParser
|
from six.moves.configparser import ConfigParser
|
||||||
|
|
||||||
try:
|
|
||||||
from swiftclient import get_auth
|
|
||||||
except ImportError:
|
|
||||||
from swift.common.internal_client import get_auth
|
|
||||||
from swift.common.internal_client import SimpleClient
|
from swift.common.internal_client import SimpleClient
|
||||||
from swift.common.ring import Ring
|
from swift.common.ring import Ring
|
||||||
from swift.common.utils import compute_eta, get_time_units, config_true_value
|
from swift.common.utils import compute_eta, get_time_units, config_true_value
|
||||||
@ -88,6 +84,11 @@ def report(success):
|
|||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
global begun, created, item_type, next_report, need_to_create, retries_done
|
global begun, created, item_type, next_report, need_to_create, retries_done
|
||||||
patcher.monkey_patch()
|
patcher.monkey_patch()
|
||||||
|
try:
|
||||||
|
# Delay importing so urllib3 will import monkey-patched modules
|
||||||
|
from swiftclient import get_auth
|
||||||
|
except ImportError:
|
||||||
|
from swift.common.internal_client import get_auth
|
||||||
|
|
||||||
conffile = '/etc/swift/dispersion.conf'
|
conffile = '/etc/swift/dispersion.conf'
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user