Project

General

Profile

Bug #34053

Add missing default values to /sharing/afp API

Added by Eric Turgeon about 1 year ago. Updated about 1 year ago.

Status:
Done
Priority:
No priority
Assignee:
Brandon Schneider
Category:
Middleware
Target version:
Severity:
Medium
Reason for Closing:
Reason for Blocked:
Needs QA:
No
Needs Doc:
No
Needs Merging:
No
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Description

Look like POST /sharing/afp have a similar problem than /sharing/cifs

__________________________________________ test_08_creating_a_afp_share_on_afp_path __________________________________________

    def test_08_creating_a_afp_share_on_afp_path():
        payload = {"name": AFP_NAME, "path": AFP_PATH}
        results = POST("/sharing/afp", payload)
>       assert results.status_code == 200, results.text
E       AssertionError: <h1>500 Internal Server Error</h1><br><h2>Traceback:</h2>
E         &lt;pre&gt;Traceback (most recent call last):
E           File &amp;quot;/usr/local/lib/python3.6/site-packages/aiohttp/web_protocol.py&amp;quot;, line 381, in start
E             resp = await self._request_handler(request)
E           File &amp;quot;/usr/local/lib/python3.6/asyncio/coroutines.py&amp;quot;, line 110, in __next__
E             return self.gen.send(None)
E           File &amp;quot;/usr/local/lib/python3.6/site-packages/aiohttp/web_app.py&amp;quot;, line 322, in _handle
E             resp = await handler(request)
E           File &amp;quot;/usr/local/lib/python3.6/asyncio/coroutines.py&amp;quot;, line 110, in __next__
E             return self.gen.send(None)
E           File &amp;quot;/usr/local/lib/python3.6/site-packages/aiohttp/web_middlewares.py&amp;quot;, line 88, in impl
E             return await handler(request)
E           File &amp;quot;/usr/local/lib/python3.6/asyncio/coroutines.py&amp;quot;, line 110, in __next__
E             return self.gen.send(None)
E           File &amp;quot;/usr/local/lib/python3.6/site-packages/aiohttp/web_middlewares.py&amp;quot;, line 78, in impl
E             return await handler(request)
E           File &amp;quot;/usr/local/lib/python3.6/asyncio/coroutines.py&amp;quot;, line 110, in __next__
E             return self.gen.send(None)
E           File &amp;quot;/usr/local/lib/python3.6/site-packages/middlewared/restful.py&amp;quot;, line 362, in on_method
E             return await do(method, req, resp, *args, **kwargs)
E           File &amp;quot;/usr/local/lib/python3.6/asyncio/coroutines.py&amp;quot;, line 110, in __next__
E             return self.gen.send(None)
E           File &amp;quot;/usr/local/lib/python3.6/site-packages/middlewared/restful.py&amp;quot;, line 488, in do
E             result = await self.middleware.call(methodname, *method_args)
E           File &amp;quot;/usr/local/lib/python3.6/asyncio/coroutines.py&amp;quot;, line 110, in __next__
E             return self.gen.send(None)
E           File &amp;quot;/usr/local/lib/python3.6/site-packages/middlewared/main.py&amp;quot;, line 1018, in call
E             return await self._call(name, serviceobj, methodobj, params, pipes=pipes)
E           File &amp;quot;/usr/local/lib/python3.6/asyncio/coroutines.py&amp;quot;, line 110, in __next__
E             return self.gen.send(None)
E           File &amp;quot;/usr/local/lib/python3.6/site-packages/middlewared/main.py&amp;quot;, line 953, in _call
E             return await methodobj(*args)
E           File &amp;quot;/usr/local/lib/python3.6/asyncio/coroutines.py&amp;quot;, line 110, in __next__
E             return self.gen.send(None)
E           File &amp;quot;/usr/local/lib/python3.6/site-packages/middlewared/service.py&amp;quot;, line 269, in create
E             f&amp;#x27;{self._config.namespace}.create&amp;#x27;, self, self.do_create, [data]
E           File &amp;quot;/usr/local/lib/python3.6/asyncio/coroutines.py&amp;quot;, line 110, in __next__
E             return self.gen.send(None)
E           File &amp;quot;/usr/local/lib/python3.6/site-packages/middlewared/main.py&amp;quot;, line 953, in _call
E             return await methodobj(*args)
E           File &amp;quot;/usr/local/lib/python3.6/asyncio/coroutines.py&amp;quot;, line 110, in __next__
E             return self.gen.send(None)
E           File &amp;quot;/usr/local/lib/python3.6/site-packages/middlewared/schema.py&amp;quot;, line 646, in nf
E             return await f(*args, **kwargs)
E           File &amp;quot;/usr/local/lib/python3.6/asyncio/coroutines.py&amp;quot;, line 110, in __next__
E             return self.gen.send(None)
E           File &amp;quot;/usr/local/lib/python3.6/site-packages/middlewared/plugins/afp.py&amp;quot;, line 81, in do_create
E             await self.clean(data, &amp;#x27;sharingafp_create&amp;#x27;, verrors)
E           File &amp;quot;/usr/local/lib/python3.6/asyncio/coroutines.py&amp;quot;, line 110, in __next__
E             return self.gen.send(None)
E           File &amp;quot;/usr/local/lib/python3.6/site-packages/middlewared/plugins/afp.py&amp;quot;, line 158, in clean
E             data[&amp;#x27;name&amp;#x27;] = await self.name_exists(data, schema_name, verrors, id)
E           File &amp;quot;/usr/local/lib/python3.6/asyncio/coroutines.py&amp;quot;, line 110, in __next__
E             return self.gen.send(None)
E           File &amp;quot;/usr/local/lib/python3.6/site-packages/middlewared/plugins/afp.py&amp;quot;, line 187, in name_exists
E             home = data[&amp;#x27;home&amp;#x27;]
E         KeyError: &amp;#x27;home&amp;#x27;
E         &lt;/pre&gt;
E       assert 500 == 200
E        +  where 500 = &lt;Response [500]&gt;.status_code

api2/afp.py:83: AssertionError

Associated revisions

Revision 9e350c18 (diff)
Added by Brandon Schneider about 1 year ago

fix(sharing/afp): Add missing default values

Ticket: #34053

Revision ae00627d (diff)
Added by Brandon Schneider about 1 year ago

fix(sharing/afp): Add missing default values (#1294)

Ticket: #34053

History

#1 Updated by Dru Lavigne about 1 year ago

  • Assignee changed from Release Council to William Grzybowski

#2 Updated by William Grzybowski about 1 year ago

  • Assignee changed from William Grzybowski to Brandon Schneider
  • Target version changed from Backlog to 11.2-BETA1
  • Severity changed from New to Medium

#3 Updated by Brandon Schneider about 1 year ago

  • Status changed from Unscreened to Not Started

#4 Updated by Brandon Schneider about 1 year ago

  • Status changed from Not Started to In Progress

#5 Updated by Brandon Schneider about 1 year ago

  • Status changed from In Progress to Ready for Testing

#6 Updated by Dru Lavigne about 1 year ago

  • Subject changed from REST API 2.0 failed to POST /sharing/afp return "500 Internal Server Error" to Add missing default values to /sharing/afp API
  • Needs Merging changed from Yes to No

#7 Updated by Eric Turgeon about 1 year ago

  • Needs QA changed from Yes to No

I have tested it and it is solved.

#8 Updated by Dru Lavigne about 1 year ago

  • Status changed from Ready for Testing to Done

Also available in: Atom PDF