Description of problem: When exporting to ansible mode is tried in gwcli before adding gateways, gwcli exited and shown python errors. It should have shown proper error message and should have stayed in gwcli prompt only. Version-Release number of selected component (if applicable): ceph-iscsi-cli-2.5-8.el7cp.noarch ceph-iscsi-config-2.3-10.el7cp.noarch Steps to Reproduce: 1.Have a ceph cluster running and login to iSCSI GW node. 2.Login to gwcli and before adding Gateways, try "export ansible" command. 3.It will throw python errors and exits from gwcli. Actual results: 1. gwcli throws traceback errors and exits. /> export ansible CMD: export mode=ansible Traceback (most recent call last): File "/usr/bin/gwcli", line 187, in <module> main() File "/usr/bin/gwcli", line 119, in main shell.run_interactive() File "/usr/lib/python2.7/site-packages/configshell_fb/shell.py", line 905, in run_interactive self._cli_loop() File "/usr/lib/python2.7/site-packages/configshell_fb/shell.py", line 734, in _cli_loop self.run_cmdline(cmdline) File "/usr/lib/python2.7/site-packages/configshell_fb/shell.py", line 848, in run_cmdline self._execute_command(path, command, pparams, kparams) File "/usr/lib/python2.7/site-packages/configshell_fb/shell.py", line 823, in _execute_command result = target.execute_command(command, pparams, kparams) File "/usr/lib/python2.7/site-packages/configshell_fb/node.py", line 1406, in execute_command return method(*pparams, **kparams) File "/usr/lib/python2.7/site-packages/gwcli/gateway.py", line 162, in ui_command_export self.export_ansible(current_config) File "/usr/lib/python2.7/site-packages/gwcli/gateway.py", line 119, in export_ansible ansible_vars.append('gateway_ip_list: "{}"'.format(",".join(config['gateways']['ip_list']))) KeyError: 'ip_list' [root@avenger ~]# gwcli /> export ansible KeyError: 'ip_list' [root@avenger ~]# Expected results: 1. Should have shown proper error message and continued in gwcli prompt only.
patched gateway module in branch BZ1498764 on github. PR raised. With this commit you see the following when trying to export with an empty config; [root@rh7-gw1 ~]# gwcli -d Adding ceph cluster 'ceph' to the UI Fetching ceph osd information Querying ceph for state information Refreshing disk information from the config object Refreshing gateway & client information Querying ceph for state information Gathering pool stats for cluster 'ceph' /> export mode=bla CMD: export mode=bla Invalid export mode requested - supported modes are: ansible,copy /> export bla CMD: export mode=bla Invalid export mode requested - supported modes are: ansible,copy /> export ansible CMD: export mode=ansible Export requested, but the config is empty /> export copy CMD: export mode=copy Export requested, but the config is empty /> export mode=copy CMD: export mode=copy Export requested, but the config is empty /> export mode=ansible CMD: export mode=ansible Export requested, but the config is empty />
Moving to 3.1.z1 since this is a low-priority issue.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2018:3530