Code Duplication    Length = 10-11 lines in 2 locations

ecs_deploy/ecs.py 2 locations

@@ 216-226 (lines=11) @@
213
                container[u'image'] = new_image
214
215
    def set_commands(self, **commands):
216
        self.validate_container_options(**commands)
217
        for container in self.containers:
218
            if container[u'name'] in commands:
219
                new_command = commands[container[u'name']]
220
                diff = EcsTaskDefinitionDiff(
221
                    container=container[u'name'],
222
                    field=u'command',
223
                    value=new_command,
224
                    old_value=container.get(u'command')
225
                )
226
                self._diff.append(diff)
227
                container[u'command'] = [new_command]
228
229
    def set_environment(self, environment_list):
@@ 231-240 (lines=10) @@
228
229
    def set_environment(self, environment_list):
230
        environment = {}
231
232
        for env in environment_list:
233
            environment.setdefault(env[0], {})
234
            environment[env[0]][env[1]] = env[2]
235
236
        self.validate_container_options(**environment)
237
        for container in self.containers:
238
            if container[u'name'] in environment:
239
                self.apply_container_environment(
240
                    container=container,
241
                    new_environment=environment[container[u'name']]
242
                )
243