$ gitlab runner all --scope active
Expected: successful list of all runners in "legacy" format (whatever it might be)
$ gitlab -o json runner all --scope active
Expected: successful list of all runners in JSON.
$ gitlab -o yaml runner all --scope active --id foobar
Traceback (most recent call last):
File "/Users/weakcamel/git/gitlab/scripts/venv/bin/gitlab", line 12, in <module>
sys.exit(main())
File "/Users/weakcamel/git/gitlab/scripts/venv/lib/python3.7/site-packages/gitlab/cli.py", line 179, in main
cli_module.run(gl, what, action, args, verbose, output, fields)
File "/Users/weakcamel/git/gitlab/scripts/venv/lib/python3.7/site-packages/gitlab/v4/cli.py", line 386, in run
printer.display_list(data, fields, verbose=verbose)
File "/Users/weakcamel/git/gitlab/scripts/venv/lib/python3.7/site-packages/gitlab/v4/cli.py", line 311, in display_list
[get_dict(obj, fields) for obj in data],
File "/Users/weakcamel/git/gitlab/scripts/venv/lib/python3.7/site-packages/gitlab/v4/cli.py", line 311, in <listcomp>
[get_dict(obj, fields) for obj in data],
File "/Users/weakcamel/git/gitlab/scripts/venv/lib/python3.7/site-packages/gitlab/v4/cli.py", line 290, in get_dict
return obj.attributes
AttributeError: 'dict' object has no attribute 'attributes'
$ gitlab -o json runner all --scope active --id foobar
Traceback (most recent call last):
File "/Users/weakcamel/git/gitlab/scripts/venv/bin/gitlab", line 12, in <module>
sys.exit(main())
File "/Users/weakcamel/git/gitlab/scripts/venv/lib/python3.7/site-packages/gitlab/cli.py", line 179, in main
cli_module.run(gl, what, action, args, verbose, output, fields)
File "/Users/weakcamel/git/gitlab/scripts/venv/lib/python3.7/site-packages/gitlab/v4/cli.py", line 386, in run
printer.display_list(data, fields, verbose=verbose)
File "/Users/weakcamel/git/gitlab/scripts/venv/lib/python3.7/site-packages/gitlab/v4/cli.py", line 300, in display_list
print(json.dumps([get_dict(obj, fields) for obj in data]))
File "/Users/weakcamel/git/gitlab/scripts/venv/lib/python3.7/site-packages/gitlab/v4/cli.py", line 300, in <listcomp>
print(json.dumps([get_dict(obj, fields) for obj in data]))
File "/Users/weakcamel/git/gitlab/scripts/venv/lib/python3.7/site-packages/gitlab/v4/cli.py", line 290, in get_dict
return obj.attributes
AttributeError: 'dict' object has no attribute 'attributes'
Description of the problem, including code/CLI snippet
There are 2 problems with
runner allcommand in CLI; I'm not sure if they're related to each other or completely independent.The
--idargument is required - while it shouldn't be - and its value seems to be ignored.With a workaround (added a dummy
--id foobarI get the output in the "legacy" format - which is slightly better - but when trying to retrieve it in JSON, it fails again with an exception. Attaching examples below.Expected Behavior
Expected: successful list of all runners in "legacy" format (whatever it might be)
Expected: successful list of all runners in JSON.
Actual Behavior
a) CLI usage failure:
b) with a workaround but in JSON or YAML output format:
Specifications