endpoint is available only when instance is available

pull/3170/head
Bruce Pennypacker 12 years ago
parent c9e373dd7d
commit 1ef29a3654

@ -493,13 +493,24 @@ def main():
'id': my_inst.id,
'create_time': my_inst.create_time,
'status': my_inst.status,
'endpoint': my_inst.endpoint[0],
'port': my_inst.endpoint[1],
'availability_zone': my_inst.availability_zone,
'backup_retention': my_inst.backup_retention_period,
'backup_window': my_inst.preferred_backup_window,
'maintenance_window': my_inst.preferred_maintenance_window,
'multi_zone': my_inst.multi_az,
'instance_type': my_inst.instance_class,
'username': my_inst.master_username,
'iops': my_inst.iops
}
# Endpoint exists only if the instance is available
if my_inst.status == 'available':
d["endpoint"] = my_inst.endpoint[0]
d["port"] = my_inst.endpoint[1]
else:
d["endpoint"] = None
d["port"] = None
module.exit_json(changed=True, instance=d)

Loading…
Cancel
Save