I'm trying to run the current trunk on Python 3. When I run cloud-init with no arguments, I get the following exception.
$ python3 bin/cloud-init
Traceback (most recent call last):
File "bin/cloud-init", line 623, in <module> sys.exit(main())
File "bin/cloud-init", line 614, in main
(name, functor) = args.action
AttributeError: 'Namespace' object has no attribute 'action'
This is caused by a chenge of behavior of argparse on Python 3 when using subparsers.
Can we workarounded by adding try-catch similar to this one:
I'm trying to run the current trunk on Python 3. When I run cloud-init with no arguments, I get the following exception.
$ python3 bin/cloud-init
sys.exit( main())
Traceback (most recent call last):
File "bin/cloud-init", line 623, in <module>
File "bin/cloud-init", line 614, in main
(name, functor) = args.action
AttributeError: 'Namespace' object has no attribute 'action'
This is caused by a chenge of behavior of argparse on Python 3 when using subparsers.
Can we workarounded by adding try-catch similar to this one:
try:
parser. print_help( )
(name, functor) = args.action
except AttributeError:
return 0
(Consider it public domain, as it is so simple)