mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-07-29 11:55:04 +00:00
Fix EndpointSpec KeyError. (#637)
This commit is contained in:
@@ -326,7 +326,7 @@ class DockerSwarmManager(DockerBaseClass):
|
||||
# Number of replicas have to be updated in calling method or may be left as None
|
||||
object_essentials['Replicas'] = None
|
||||
object_essentials['Image'] = item['Spec']['TaskTemplate']['ContainerSpec']['Image']
|
||||
if 'Ports' in item['Spec']['EndpointSpec']:
|
||||
if item['Spec'].get('EndpointSpec') and 'Ports' in item['Spec']['EndpointSpec']:
|
||||
object_essentials['Ports'] = item['Spec']['EndpointSpec']['Ports']
|
||||
else:
|
||||
object_essentials['Ports'] = []
|
||||
|
||||
Reference in New Issue
Block a user