Merge "Pass swiftclient header values as strings"
This commit is contained in:
commit
d0b2985bc5
|
@ -2303,7 +2303,7 @@ def _store_configdrive(node, configdrive):
|
|||
container = CONF.conductor.configdrive_swift_container
|
||||
object_name = _get_configdrive_obj_name(node)
|
||||
|
||||
object_headers = {'X-Delete-After': timeout}
|
||||
object_headers = {'X-Delete-After': str(timeout)}
|
||||
|
||||
with tempfile.NamedTemporaryFile(dir=CONF.tempdir) as fileobj:
|
||||
fileobj.write(configdrive)
|
||||
|
|
|
@ -135,7 +135,7 @@ def copy_image_to_swift(source_file_path, destination_object_name):
|
|||
container = CONF.ilo.swift_ilo_container
|
||||
timeout = CONF.ilo.swift_object_expiry_timeout
|
||||
|
||||
object_headers = {'X-Delete-After': timeout}
|
||||
object_headers = {'X-Delete-After': str(timeout)}
|
||||
swift_api = swift.SwiftAPI()
|
||||
swift_api.create_object(container, destination_object_name,
|
||||
source_file_path, object_headers=object_headers)
|
||||
|
|
|
@ -310,7 +310,7 @@ def store_ramdisk_logs(node, logs):
|
|||
|
||||
# convert days to seconds
|
||||
timeout = CONF.agent.deploy_logs_swift_days_to_expire * 86400
|
||||
object_headers = {'X-Delete-After': timeout}
|
||||
object_headers = {'X-Delete-After': str(timeout)}
|
||||
swift_api = swift.SwiftAPI()
|
||||
swift_api.create_object(
|
||||
CONF.agent.deploy_logs_swift_container, logs_file_name,
|
||||
|
|
|
@ -4349,7 +4349,7 @@ class StoreConfigDriveTestCase(tests_base.TestCase):
|
|||
container_name = 'foo_container'
|
||||
timeout = 123
|
||||
expected_obj_name = 'configdrive-%s' % self.node.uuid
|
||||
expected_obj_header = {'X-Delete-After': timeout}
|
||||
expected_obj_header = {'X-Delete-After': str(timeout)}
|
||||
expected_instance_info = {'configdrive': 'http://1.2.3.4'}
|
||||
|
||||
# set configs and mocks
|
||||
|
|
|
@ -240,7 +240,7 @@ class IloCommonMethodsTestCase(db_base.DbTestCase):
|
|||
deploy_args = {'arg1': 'val1', 'arg2': 'val2'}
|
||||
swift_obj_mock.get_temp_url.return_value = 'temp-url'
|
||||
timeout = CONF.ilo.swift_object_expiry_timeout
|
||||
object_headers = {'X-Delete-After': timeout}
|
||||
object_headers = {'X-Delete-After': str(timeout)}
|
||||
|
||||
with task_manager.acquire(self.context, self.node.uuid,
|
||||
shared=False) as task:
|
||||
|
@ -772,7 +772,7 @@ class IloCommonMethodsTestCase(db_base.DbTestCase):
|
|||
swift_obj_mock = swift_api_mock.return_value
|
||||
destination_object_name = 'destination_object_name'
|
||||
source_file_path = 'tmp_image_file'
|
||||
object_headers = {'X-Delete-After': timeout}
|
||||
object_headers = {'X-Delete-After': str(timeout)}
|
||||
# | WHEN |
|
||||
ilo_common.copy_image_to_swift(source_file_path,
|
||||
destination_object_name)
|
||||
|
|
|
@ -355,7 +355,7 @@ class UtilsRamdiskLogsTestCase(tests_base.TestCase):
|
|||
|
||||
mock_swift.return_value.create_object.assert_called_once_with(
|
||||
container_name, file_name, mock.ANY,
|
||||
object_headers={'X-Delete-After': 86400})
|
||||
object_headers={'X-Delete-After': '86400'})
|
||||
mock_logs_name.assert_called_once_with(self.node)
|
||||
|
||||
@mock.patch.object(os, 'makedirs', autospec=True)
|
||||
|
|
Loading…
Reference in New Issue