Merge ""zun cp" command returns incorrect error message"
This commit is contained in:
commit
d67d3a2aa0
@ -601,15 +601,26 @@ class DockerDriver(driver.ContainerDriver):
|
|||||||
@wrap_docker_error
|
@wrap_docker_error
|
||||||
def get_archive(self, context, container, path):
|
def get_archive(self, context, container, path):
|
||||||
with docker_utils.docker_client() as docker:
|
with docker_utils.docker_client() as docker:
|
||||||
stream, stat = docker.get_archive(container.container_id, path)
|
try:
|
||||||
filedata = stream.read()
|
stream, stat = docker.get_archive(
|
||||||
return filedata, stat
|
container.container_id, path)
|
||||||
|
filedata = stream.read()
|
||||||
|
return filedata, stat
|
||||||
|
except errors.APIError as api_error:
|
||||||
|
if is_not_found(api_error):
|
||||||
|
raise exception.Invalid(_("%s") % str(api_error))
|
||||||
|
raise
|
||||||
|
|
||||||
@check_container_id
|
@check_container_id
|
||||||
@wrap_docker_error
|
@wrap_docker_error
|
||||||
def put_archive(self, context, container, path, data):
|
def put_archive(self, context, container, path, data):
|
||||||
with docker_utils.docker_client() as docker:
|
with docker_utils.docker_client() as docker:
|
||||||
docker.put_archive(container.container_id, path, data)
|
try:
|
||||||
|
docker.put_archive(container.container_id, path, data)
|
||||||
|
except errors.APIError as api_error:
|
||||||
|
if is_not_found(api_error):
|
||||||
|
raise exception.Invalid(_("%s") % str(api_error))
|
||||||
|
raise
|
||||||
|
|
||||||
@check_container_id
|
@check_container_id
|
||||||
@wrap_docker_error
|
@wrap_docker_error
|
||||||
|
Loading…
Reference in New Issue
Block a user