fix(rds2): handle create_db_instance when AllocatedStorage is not specified

In all of the tests of `create_db_instance()`, the `AllocatedStorage`
parameter is provided.  The [RDS API
reference](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html)
says this parameter is optional; however, when none is provided, moto
returns an obscure error message:

```
self = <botocore.parsers.QueryParser object at 0x113745890>, shape = <Shape(Integer)>, text = 'None'

    @_text_content
    def _handle_integer(self, shape, text):
>       return int(text)
E       ValueError: invalid literal for int() with base 10: 'None'

/usr/local/Cellar/pyenv/1.2.13_1/versions/3.7.4/envs/rds_encrypt/lib/python3.7/site-packages/botocore/parsers.py:466: ValueError
```

This PR adds default values that correspond to the current default API
behaviors.
This commit is contained in:
Stephen Huff 2019-10-15 16:18:37 -04:00
commit 7b1cf9eecd
3 changed files with 92 additions and 1 deletions

View file

@ -42,7 +42,7 @@ class RDS2Response(BaseResponse):
"region": self.region,
"security_groups": self._get_multi_param('DBSecurityGroups.DBSecurityGroupName'),
"storage_encrypted": self._get_param("StorageEncrypted"),
"storage_type": self._get_param("StorageType", 'standard'),
"storage_type": self._get_param("StorageType", None),
"vpc_security_group_ids": self._get_multi_param("VpcSecurityGroupIds.VpcSecurityGroupId"),
"tags": list(),
}