Merge "py3: fix swift-dispersion-populate"

This commit is contained in:
Zuul
2019年10月15日 14:54:03 +00:00
committed by Gerrit Code Review

View File

@@ -15,6 +15,7 @@
# limitations under the License.
from __future__ import print_function
import io
import traceback
from optparse import OptionParser
from sys import exit, stdout
@@ -22,8 +23,8 @@ from time import time
from eventlet import GreenPool, patcher, sleep
from eventlet.pools import Pool
import six
from six.moves import range
from six.moves import cStringIO as StringIO
from six.moves.configparser import ConfigParser
try:
@@ -56,7 +57,8 @@ def put_object(connpool, container, obj, report):
global retries_done
try:
with connpool.item() as conn:
conn.put_object(container, obj, StringIO(obj),
data = io.BytesIO(obj if six.PY2 else obj.encode('utf8'))
conn.put_object(container, obj, data,
headers={'x-object-meta-dispersion': obj})
retries_done += conn.attempts - 1
if report:
Reference in New Issue
openstack/swift
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.

The note is not visible to the blocked user.