|
3 | 3 | import re |
4 | 4 | import copy |
5 | 5 | from collections import defaultdict |
6 | | -import warnings |
7 | 6 | import logging |
8 | 7 | import click_log |
9 | 8 |
|
@@ -967,7 +966,7 @@ def add_containers(self, containers_list): |
967 | 966 | containers_tmp = list(self.containers) |
968 | 967 | for container in set(containers_list): |
969 | 968 | if container in self.container_names: |
970 | | - warnings.warn("Cannot add container '{container}', already in the task definition.".format(container=container)) |
| 969 | + logger.warning("Cannot add container '{container}', already in the task definition.".format(container=container)) |
971 | 970 | continue |
972 | 971 | mapping = {} |
973 | 972 | mapping["name"] = container |
@@ -1003,12 +1002,12 @@ def remove_containers(self, containers_list): |
1003 | 1002 | containers_not_found = list(containers_ - set(self.container_names)) |
1004 | 1003 | # Remaining containers could not be found. |
1005 | 1004 | for container in containers_not_found: |
1006 | | - warnings.warn("Cannot remove container '{container}', not in the task definition.".format(container=container)) |
| 1005 | + logger.warning("Cannot remove container '{container}', not in the task definition.".format(container=container)) |
1007 | 1006 |
|
1008 | 1007 | if containers: |
1009 | 1008 | self.containers = containers |
1010 | 1009 | else: |
1011 | | - warnings.warn("No container left after removal. Using original containers, not removing '{containers_}'.".format(container=container)) |
| 1010 | + logger.warning("No container left after removal. Using original containers, not removing '{containers_}'.".format(container=container)) |
1012 | 1011 |
|
1013 | 1012 | if not self.containers == containers_tmp: |
1014 | 1013 | diff = EcsTaskDefinitionDiff( |
|
0 commit comments