Project

General

Profile

Feature #7104

Updated by Greg Farnum over 9 years ago

Right now When looking at the commands must be one of "r", "rw", "rwx". We should support each of those documentation for MDS: 
 http://apiserver:5000/api/v0.1/mds 

 <pre> 
 __main__ ERROR: Exception on /api/v0.1/mds [GET] 
 Traceback (most recent call last): 
   File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1504, in wsgi_app 
     response = self.full_dispatch_request() 
   File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1264, in full_dispatch_request 
     rv = self.handle_user_exception(e) 
   File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1262, in full_dispatch_request 
     rv = self.dispatch_request() 
   File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1248, in dispatch_request 
     return self.view_functions[rule.endpoint](**req.view_args) 
   File "/usr/lib/python2.7/dist-packages/ceph_rest_api.py", line 418, in handler 
     helptext = show_human_help(prefix) 
   File "/usr/lib/python2.7/dist-packages/ceph_rest_api.py", line 292, in show_human_help 
     line.append(permmap[cmdsig['perm']]) 
 </pre> 

 Since the mds API calls are also documented in "/", this causes "/" to fail with the same 500 error. 

 Relevant line: 
 https://github.com/ceph/ceph/blob/master/src/pybind/ceph_rest_api.py#L292 

 By replacing that line with a simple try/except: 
 <pre> 
 try: 
     line.append(permmap[cmdsig['perm']]) 
 except KeyError as capabilities, e: 
     line.append("Unknown") 
 </pre> 

 I was able to find two calls that do not as named user levels. have a bound method: 
 <pre> 
 mds/set?key=allow_new_snaps&sure={sure(< string>)} 	 Unknown 	 set <key> 
 mds/unset?key=allow_new_snaps&sure={sure (<string>)} 	 Unknown 	 unset <key> 
 </pre> 

 I have tried to look where the mapping between the API and the methods take place but no luck. 

 Will gladly submit a pull request if someone points me in the right direction.

Back