Skip to content

Commit

Permalink
add condition to avoid evaluating the c_tags array as None
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlyF committed Aug 21, 2017
1 parent 1a00117 commit 93385cf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion utils/service_discovery/sd_docker_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,10 @@ def _fill_tpl(self, state, c_id, instance_tpl, variables, c_tags=None):
c_image = state.inspect_container(c_id).get('Config', {}).get('Image', '')

# add only default c_tags to the instance to avoid duplicate tags from conf
tags = c_tags[:]
if c_tags:
tags = c_tags[:] # shallow copy of the c_tags array
else
tags = []
if tags:
tpl_tags = instance_tpl.get('tags', [])
if isinstance(tpl_tags, dict):
Expand Down

0 comments on commit 93385cf

Please sign in to comment.