Project

General

Profile

Backport #23708

Updated by Nathan Cutler about 6 years ago

https://github.com/ceph/ceph/pull/21414 The error case in validate_command() where the command is found but the 
 command itself is somehow invalid raises an UnboundLocalError, because it 
 tries to refer to a variable named 'e', but it should be 'ex'.    For example: 

   # ceph balancer mode 
   Traceback (most recent call last): 
     File "/usr/bin/ceph", line 1178, in <module> 
       retval = main() 
     File "/usr/bin/ceph", line 1109, in main 
       verbose) 
     File "/usr/bin/ceph", line 535, in new_style_command 
       valid_dict = validate_command(sigdict, cmdargs, verbose) 
     File "/usr/lib/python3.6/site-packages/ceph_argparse.py", line 1090, in validate_command 
       print("Invalid command:", e, file=sys.stderr) 
   UnboundLocalError: local variable 'e' referenced before assignment

Back