sonata-nfv / tng-sdk-project

The 5GTANGO SDK tool to manage network service projects.
http://www.5gtango.eu
Apache License 2.0
5 stars 4 forks source link

Internal service error when GETing projects before creating any #84

Closed stefanbschneider closed 5 years ago

stefanbschneider commented 5 years ago

When starting the service any locally and calling

$ curl -X GET localhost:5098/api/v1/projects             # show all projects
$ curl -X POST localhost:5098/api/v1/projects            # create a new project

I get an internal server error.

If I do it the other way around, it works. This suggests that there's an issue with the GET call if no projects exist. This should be fixed to simply return an empty list.

stefanbschneider commented 5 years ago

Probably, the projects folder doesn't exist yet, leading to a crash in this line: https://github.com/sonata-nfv/tng-sdk-project/blob/master/src/tngsdk/rest.py#L198