docker_swarm_service: Report warnings on update (#53999)

* Report warnings on update

* Add comment about warnings support
pull/53972/head
Hannes Ljungberg 6 years ago committed by ansibot
parent 3398ce278c
commit e2371d4b52

@ -2249,14 +2249,14 @@ class DockerServiceManager(object):
def update_service(self, name, old_service, new_service):
service_data = new_service.build_docker_service(self.get_networks_names_ids())
self.client.update_service(
result = self.client.update_service(
old_service.service_id,
old_service.service_version,
name=name,
**service_data
)
# Unfortunately, docker-py f***ed up and doesn't return the structure
# the corresponding API call returns, which would include a list of warnings.
# Prior to Docker SDK 4.0.0 no warnings were returned and will thus be ignored.
self.client.report_warnings(result, ['Warning'])
def create_service(self, name, service):
service_data = service.build_docker_service(self.get_networks_names_ids())

Loading…
Cancel
Save