Code Duplication    Length = 10-11 lines in 2 locations

ecs_deploy/ecs.py 2 locations

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