Expected behavior: the MW should be created and ID returned.
Actual behavior: error 500 - Internal Server Error:
{"code":500,"description":"The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.","name":"Internal Server Error"}
From the Kytos log:
Mar 11 16:00:57 18d7d38a4769 kytos.core.controller:ERROR app:1892: Exception on /api/kytos/maintenance [POST]
Mar 11 16:00:57 18d7d38a4769 Traceback (most recent call last):
Mar 11 16:00:57 18d7d38a4769 File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 2447, in wsgi_app
Mar 11 16:00:57 18d7d38a4769 response = self.full_dispatch_request()
Mar 11 16:00:57 18d7d38a4769 File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1952, in full_dispatch_request
Mar 11 16:00:57 18d7d38a4769 rv = self.handle_user_exception(e)
Mar 11 16:00:57 18d7d38a4769 File "/usr/local/lib/python3.6/dist-packages/flask_cors/extension.py", line 161, in wrapped_function
Mar 11 16:00:57 18d7d38a4769 return cors_after_request(app.make_response(f(*args, **kwargs)))
Mar 11 16:00:57 18d7d38a4769 File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1821, in handle_user_exception
Mar 11 16:00:57 18d7d38a4769 reraise(exc_type, exc_value, tb)
Mar 11 16:00:57 18d7d38a4769 File "/usr/local/lib/python3.6/dist-packages/flask/_compat.py", line 39, in reraise
Mar 11 16:00:57 18d7d38a4769 raise value
Mar 11 16:00:57 18d7d38a4769 File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1950, in full_dispatch_request
Mar 11 16:00:57 18d7d38a4769 rv = self.dispatch_request()
Mar 11 16:00:57 18d7d38a4769 File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1936, in dispatch_request
Mar 11 16:00:57 18d7d38a4769 return self.view_functions[rule.endpoint](**req.view_args)
Mar 11 16:00:57 18d7d38a4769 File "//var/lib/kytos/napps/kytos/maintenance/main.py", line 71, in create_mw
Mar 11 16:00:57 18d7d38a4769 maintenance = MW.from_dict(data, self.controller)
Mar 11 16:00:57 18d7d38a4769 File "//var/lib/kytos/napps/../napps/kytos/maintenance/models.py", line 89, in from_dict
Mar 11 16:00:57 18d7d38a4769 description = mw_dict['description'] or None
Mar 11 16:00:57 18d7d38a4769 KeyError: 'description'
Even though the description is not mandatory according to the API documentation, if you create a MW without providing it, Kytos will return error 500.
Steps to reproduce:
Expected behavior: the MW should be created and ID returned.
Actual behavior: error 500 - Internal Server Error:
From the Kytos log:
Workaround: provide the any description: