Project

General

Profile

Actions

Bug #48307

closed

mgr restful encountering AttributeError while humanifying command

Added by Prashant D over 3 years ago. Updated over 3 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
restful module
Target version:
-
% Done:

0%

Source:
Development
Tags:
Backport:
nautilus
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

The restful module encountering AttributeError due to python2 to python3 migration issue

2020-11-13 10:26:38.264 7f9672fca700 0 mgr[restful] Traceback (most recent call last):
File "/lib/python3.6/site-packages/pecan/core.py", line 683, in call
self.invoke_controller(controller, args, kwargs, state)
File "/lib/python3.6/site-packages/pecan/core.py", line 574, in invoke_controller
result = controller(*args, **kwargs)
File "/usr/share/ceph/mgr/restful/decorators.py", line 35, in decorated
return f(*args, **kwargs)
File "/usr/share/ceph/mgr/restful/api/request.py", line 88, in post
return context.instance.submit_request(request.json, **kwargs)
File "/usr/share/ceph/mgr/restful/module.py", line 589, in submit_request
request = CommandsRequest(_request)
File "/usr/share/ceph/mgr/restful/module.py", line 69, in init
results = self.run(commands_arrays0)
File "/usr/share/ceph/mgr/restful/module.py", line 87, in run
result.command = common.humanify_command(command)
File "/usr/share/ceph/mgr/restful/common.py", line 37, in humanify_command
for arg, val in command.iteritems():
AttributeError: 'dict' object has no attribute 'iteritems'

2020-11-13 10:26:38.270 7f9672fca700 0 mgr[restful] Error on request:
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/werkzeug/serving.py", line 209, in run_wsgi
execute(self.server.app)
File "/usr/lib/python3.6/site-packages/werkzeug/serving.py", line 197, in execute
application_iter = app(environ, start_response)
File "/usr/lib/python3.6/site-packages/pecan/middleware/recursive.py", line 56, in call
return self.application(environ, start_response)
File "/usr/lib/python3.6/site-packages/pecan/core.py", line 840, in call
return super(Pecan, self).__call__(environ, start_response)
File "/usr/lib/python3.6/site-packages/pecan/core.py", line 683, in call
self.invoke_controller(controller, args, kwargs, state)
File "/usr/lib/python3.6/site-packages/pecan/core.py", line 574, in invoke_controller
result = controller(*args, **kwargs)
File "/usr/share/ceph/mgr/restful/decorators.py", line 35, in decorated
return f(*args, **kwargs)
File "/usr/share/ceph/mgr/restful/api/request.py", line 88, in post
return context.instance.submit_request(request.json, **kwargs)
File "/usr/share/ceph/mgr/restful/module.py", line 589, in submit_request
request = CommandsRequest(_request)
File "/usr/share/ceph/mgr/restful/module.py", line 69, in init
results = self.run(commands_arrays0)
File "/usr/share/ceph/mgr/restful/module.py", line 87, in run
result.command = common.humanify_command(command)
File "/usr/share/ceph/mgr/restful/common.py", line 37, in humanify_command
for arg, val in command.iteritems():
AttributeError: 'dict' object has no attribute 'iteritems'

The command.iteritems() should be list(command.iteritems()) here.


Related issues 1 (0 open1 closed)

Is duplicate of mgr - Bug #46980: pybind/mgr/restful: use dict.items() for py3 compatibleResolved

Actions
Actions #1

Updated by Prashant D over 3 years ago

Prashant D wrote:

The restful module encountering AttributeError due to python2 to python3 migration issue

2020-11-13 10:26:38.264 7f9672fca700 0 mgr[restful] Traceback (most recent call last):
File "/lib/python3.6/site-packages/pecan/core.py", line 683, in call
self.invoke_controller(controller, args, kwargs, state)
File "/lib/python3.6/site-packages/pecan/core.py", line 574, in invoke_controller
result = controller(*args, **kwargs)
File "/usr/share/ceph/mgr/restful/decorators.py", line 35, in decorated
return f(*args, **kwargs)
File "/usr/share/ceph/mgr/restful/api/request.py", line 88, in post
return context.instance.submit_request(request.json, **kwargs)
File "/usr/share/ceph/mgr/restful/module.py", line 589, in submit_request
request = CommandsRequest(_request)
File "/usr/share/ceph/mgr/restful/module.py", line 69, in init
results = self.run(commands_arrays0)
File "/usr/share/ceph/mgr/restful/module.py", line 87, in run
result.command = common.humanify_command(command)
File "/usr/share/ceph/mgr/restful/common.py", line 37, in humanify_command
for arg, val in command.iteritems():
AttributeError: 'dict' object has no attribute 'iteritems'

2020-11-13 10:26:38.270 7f9672fca700 0 mgr[restful] Error on request:
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/werkzeug/serving.py", line 209, in run_wsgi
execute(self.server.app)
File "/usr/lib/python3.6/site-packages/werkzeug/serving.py", line 197, in execute
application_iter = app(environ, start_response)
File "/usr/lib/python3.6/site-packages/pecan/middleware/recursive.py", line 56, in call
return self.application(environ, start_response)
File "/usr/lib/python3.6/site-packages/pecan/core.py", line 840, in call
return super(Pecan, self).__call__(environ, start_response)
File "/usr/lib/python3.6/site-packages/pecan/core.py", line 683, in call
self.invoke_controller(controller, args, kwargs, state)
File "/usr/lib/python3.6/site-packages/pecan/core.py", line 574, in invoke_controller
result = controller(*args, **kwargs)
File "/usr/share/ceph/mgr/restful/decorators.py", line 35, in decorated
return f(*args, **kwargs)
File "/usr/share/ceph/mgr/restful/api/request.py", line 88, in post
return context.instance.submit_request(request.json, **kwargs)
File "/usr/share/ceph/mgr/restful/module.py", line 589, in submit_request
request = CommandsRequest(_request)
File "/usr/share/ceph/mgr/restful/module.py", line 69, in init
results = self.run(commands_arrays0)
File "/usr/share/ceph/mgr/restful/module.py", line 87, in run
result.command = common.humanify_command(command)
File "/usr/share/ceph/mgr/restful/common.py", line 37, in humanify_command
for arg, val in command.iteritems():
AttributeError: 'dict' object has no attribute 'iteritems'

The command.iteritems() should be command.items() here.

Actions #2

Updated by Prashant D over 3 years ago

  • Status changed from New to Resolved
  • Assignee deleted (Prashant D)
  • Backport changed from nautilus,octopus to nautilus
  • Pull request ID set to 29356
Actions #3

Updated by Nathan Cutler over 3 years ago

  • Status changed from Resolved to Duplicate

duplicate of #46980

Actions #4

Updated by Nathan Cutler over 3 years ago

  • Is duplicate of Bug #46980: pybind/mgr/restful: use dict.items() for py3 compatible added
Actions

Also available in: Atom PDF