AC-687 Add ec2/rax region choices to inventory source options response, add validation for source_regions.

This commit is contained in:
Chris Church
2013-11-20 15:19:44 -05:00
parent 7929cfedd8
commit 8bf198f7ed
4 changed files with 199 additions and 0 deletions

View File

@@ -677,6 +677,13 @@ class InventorySourceSerializer(BaseSerializer):
# FIXME
return attrs
def metadata(self):
metadata = super(InventorySourceSerializer, self).metadata()
field_opts = metadata.get('source_regions', {})
field_opts['ec2_region_choices'] = self.opts.model.get_ec2_region_choices()
field_opts['rax_region_choices'] = self.opts.model.get_rax_region_choices()
return metadata
class InventoryUpdateSerializer(BaseSerializer):