opened
gayathri-menath
username_0
Consider I have an 'ecs' script snippet 
```
{
    "containerDefinitions": [
        {
            "essential": true, 
            "image": "ctlc/serf", 
            "name": "serf", 
            "portMappings": [
                {
                    "containerPort": 7373
                }, 
                {
                    "containerPort": 7946, 
                    "hostPort": 80
                }
            ]
        }
  ]
}
```
I tried to convert the above configuration to compose format using the command `cat tranform.txt | container-transform  --input-type ecs --output-type compose`. I got an error like this.
```
 File "/local/lib/python2.7/site-packages/container_transform/ecs.py", line 113, in _parse_port_mapping
    'host_port': int(mapping['hostPort']),
KeyError: 'hostPort'
```
After exploring the source code, I could find that you are accessing the `hostPort` key without checking its presence.
Port mapping error while converting ecs to compose
issue
created
micahhausler
username_1
Thanks for reporting this! I'll take a look at it later this week
comment
closed
micahhausler
username_1
issue