Add connection error handling
This commit is contained in:
parent
d7bd142387
commit
1e2b8b1652
5 changed files with 106 additions and 29 deletions
|
|
@ -92,9 +92,11 @@ class VirtualMachineSerializer(serializers.Serializer):
|
|||
|
||||
template_id = serializers.ChoiceField(
|
||||
choices=[(key.id, key.name) for key in
|
||||
OpenNebulaManager().get_templates()],
|
||||
OpenNebulaManager().try_get_templates()
|
||||
],
|
||||
source='template.template_id',
|
||||
write_only=True
|
||||
write_only=True,
|
||||
default=[]
|
||||
)
|
||||
|
||||
def create(self, validated_data):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue