Project

General

Profile

Actions

Bug #49495

closed

qa/ceph_manager: raw_cluster_cmd passes both args and kwargs

Added by Rishabh Dave about 3 years ago. Updated about 3 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
% Done:

0%

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

Description

See: https://github.com/ceph/ceph/commit/c0907f99e87898f7e0afd47f4ed143b20a477cb7

Following is dummy program demonstrating the issue -

def a(args, stdout=None, stderr=None):
    print('running a()')
    print(f'args - {args}')
    print(f'stdout - {stdout}')
    print(f'stderr - {stderr}')

def b(*args, **kwargs):
    print('running b()')
    stdout = kwargs.pop('stdout', 'efgh')
    a(args=args, stdout=stdout, **kwargs)

b('abcd')
b(args='abcd', stdout='efgh')

Here's the output -

running b()
running a()
args - ('abcd',)
stdout - efgh
stderr - None
running b()
Traceback (most recent call last):
  File "temp.py", line 13, in <module>
    b(args='abcd', stdout='efgh')
  File "temp.py", line 10, in b
    a(args=args, stdout=stdout, **kwargs)
TypeError: a() got multiple values for keyword argument 'args'

Actions #1

Updated by Rishabh Dave about 3 years ago

  • Pull request ID set to 39690
Actions #2

Updated by Kefu Chai about 3 years ago

  • Status changed from In Progress to Resolved
Actions

Also available in: Atom PDF