From df036fe207ad38f1821b56905c14836e7c375176 Mon Sep 17 00:00:00 2001 From: Chris Henry Date: Tue, 27 Jan 2015 01:28:38 -0500 Subject: [PATCH] rds2 model fixes. * Add the endpoint data to the to_json function. * Remove the DBInstance key from the to_json template. --- moto/rds2/models.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/moto/rds2/models.py b/moto/rds2/models.py index 228593dcc..63f0c07af 100644 --- a/moto/rds2/models.py +++ b/moto/rds2/models.py @@ -158,7 +158,7 @@ class Database(object): return database def to_json(self): - template = Template(""""DBInstance": { + template = Template("""{ "AllocatedStorage": 10, "AutoMinorVersionUpgrade": "{{ database.auto_minor_version_upgrade }}", "AvailabilityZone": "{{ database.availability_zone }}", @@ -222,7 +222,10 @@ class Database(object): "PreferredMaintenanceWindow": "{{ database.preferred_maintenance_window }}", "PubliclyAccessible": "{{ database.publicly_accessible }}", "AllocatedStorage": "{{ database.allocated_storage }}", - "Endpoint": null, + "Endpoint": { + "Address": "{{ database.address }}", + "Port": "{{ database.port }}" + }, "InstanceCreateTime": null, "Iops": null, "ReadReplicaDBInstanceIdentifiers": [{%- for replica in database.replicas -%}