clients should handle keyboard interrupt

Bug #1367283 reported by Rakesh H S
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Invalid
Undecided
Unassigned
python-heatclient
Fix Released
Medium
Rakesh H S
python-ironicclient
Fix Released
Low
Rakesh H S
python-keystoneclient
Fix Released
Low
Rakesh H S
python-neutronclient
Fix Released
Low
Rakesh H S

Bug Description

When an user intentionally provides an keyboard interrupt, heat-client should provide an crisp message instead of throwing an entire traceback on to the terminal.

As of today nova-client handles keyboard interrupts and provides the following crisp message:
-----------------------------------
stack@ubuntu:/home/x/devstack$ nova list
^CShutting down novaclient
-----------------------------------
also:
----------------------------------
stack@ubuntu:/home/rakesh/devstack$ glance image-list
^C... terminating glance client
stack@ubuntu:/home/rakesh/devstack$ cinder list
^C... terminating cinder client
-----------------------------------

whereas heat-client throws the entire traceback on to the terminal and fills up the terminal space:
-------------------------------------
stack@ubuntu:/home/x/devstack$ heat stack-list
^CTraceback (most recent call last):
  File "/usr/local/bin/heat", line 10, in <module>
    sys.exit(main())
  File "/opt/stack/python-heatclient/heatclient/shell.py", line 443, in main
    HeatShell().main(args)
  File "/opt/stack/python-heatclient/heatclient/shell.py", line 399, in main
    args.func(client, args)
  File "/opt/stack/python-heatclient/heatclient/v1/shell.py", line 446, in do_stack_list
    utils.print_list(stacks, fields, sortby_index=3)
  File "/opt/stack/python-heatclient/heatclient/openstack/common/cliutils.py", line 154, in print_list
    for o in objs:
  File "/opt/stack/python-heatclient/heatclient/v1/stacks.py", line 85, in paginate
    stacks = self._list(url, 'stacks')
  File "/opt/stack/python-heatclient/heatclient/openstack/common/apiclient/base.py", line 115, in _list
    body = self.client.get(url).json()
  File "/opt/stack/python-heatclient/heatclient/common/http.py", line 270, in get
    return self.client_request("GET", url, **kwargs)
  File "/opt/stack/python-heatclient/heatclient/common/http.py", line 263, in client_request
    resp, body = self.json_request(method, url, **kwargs)
  File "/opt/stack/python-heatclient/heatclient/common/http.py", line 244, in json_request
    resp = self._http_request(url, method, **kwargs)
  File "/opt/stack/python-heatclient/heatclient/common/http.py", line 183, in _http_request
    **kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/api.py", line 44, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 383, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 486, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 330, in send
    timeout=timeout
  File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 542, in urlopen
    body=body, headers=headers)
  File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 394, in _make_request
    httplib_response = conn.getresponse(buffering=True)
  File "/usr/lib/python2.7/httplib.py", line 1045, in getresponse
    response.begin()
  File "/usr/lib/python2.7/httplib.py", line 409, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python2.7/httplib.py", line 365, in _read_status
    line = self.fp.readline(_MAXLINE + 1)
  File "/usr/lib/python2.7/socket.py", line 476, in readline
    data = self._sock.recv(self._rbufsize)
KeyboardInterrupt
--------------------------------------------

Rakesh H S (rh-s)
Changed in heat:
assignee: nobody → Rakesh H S (rh-s)
Rakesh H S (rh-s)
description: updated
Changed in heat:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Steven Hardy (shardy) wrote :

Reassigned to the correct launchpad component, as this is about a fix for python-heatclient

Changed in python-heatclient:
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → Rakesh H S (rh-s)
Changed in heat:
status: Triaged → Invalid
importance: Medium → Undecided
assignee: Rakesh H S (rh-s) → nobody
Rakesh H S (rh-s)
Changed in python-ironicclient:
assignee: nobody → Rakesh H S (rh-s)
Rakesh H S (rh-s)
summary: - heat-client should handle keyboard interrupt
+ clients should handle keyboard interrupt
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-heatclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/120440

Changed in python-heatclient:
status: Triaged → In Progress
Dmitry Tantsur (divius)
Changed in python-ironicclient:
status: New → Triaged
importance: Undecided → Low
tags: added: low-hanging-fruit
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-ironicclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/120767

Changed in python-ironicclient:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-ironicclient (master)

Reviewed: https://review.openstack.org/120767
Committed: https://git.openstack.org/cgit/openstack/python-ironicclient/commit/?id=ad8c27f8e044c4bde319acbb0942f63e7a72e456
Submitter: Jenkins
Branch: master

commit ad8c27f8e044c4bde319acbb0942f63e7a72e456
Author: Rakesh H S <email address hidden>
Date: Thu Sep 11 17:17:39 2014 +0530

    handles keyboard interrupt

    When an user intentionally provides an keyboard interrupt, ironicclient
    throws the entire traceback on to the terminal instead of handling it.
    ironicclient will now handle the keyboard interrrupt and provides an crisp
    message on to the terminal.

    Change-Id: I8e657dc0cf64fa3396fb8fd32c5ffb57016ce864
    Closes-Bug: #1367283

Changed in python-ironicclient:
status: In Progress → Fix Committed
Rakesh H S (rh-s)
Changed in python-keystoneclient:
assignee: nobody → Rakesh H S (rh-s)
Changed in python-neutronclient:
assignee: nobody → Rakesh H S (rh-s)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-keystoneclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/121046

Changed in python-keystoneclient:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-heatclient (master)

Reviewed: https://review.openstack.org/120440
Committed: https://git.openstack.org/cgit/openstack/python-heatclient/commit/?id=ec44d2a49e2bbc7e486bb1c3399376a61dee357e
Submitter: Jenkins
Branch: master

commit ec44d2a49e2bbc7e486bb1c3399376a61dee357e
Author: Rakesh H S <email address hidden>
Date: Wed Sep 10 19:56:37 2014 +0530

    handles keyboard interrupt

    When an user intentionally provides an keyboard interrupt, heatclient
    throws the entire traceback on to the terminal instead of handling it.

    heatclient will now handle the keyboard interrrupt and provides an crisp
    message on to the terminal.

    Change-Id: Iaa30048e7948d7db1d5b256dd59ca2e0dd842df9
    Closes-Bug: #1367283

Changed in python-heatclient:
status: In Progress → Fix Committed
Changed in python-heatclient:
milestone: none → v0.2.11
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-neutronclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/123333

Changed in python-neutronclient:
status: New → In Progress
Changed in python-heatclient:
status: Fix Committed → Fix Released
Changed in python-keystoneclient:
importance: Undecided → Low
Kyle Mestery (mestery)
Changed in python-neutronclient:
importance: Undecided → Low
milestone: none → 2.3.9
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-neutronclient (master)

Reviewed: https://review.openstack.org/123333
Committed: https://git.openstack.org/cgit/openstack/python-neutronclient/commit/?id=a1a8a0e2b24e06b04dd211c00dd52ae3a2056490
Submitter: Jenkins
Branch: master

commit a1a8a0e2b24e06b04dd211c00dd52ae3a2056490
Author: Rakesh H S <email address hidden>
Date: Tue Sep 23 11:09:35 2014 +0530

    handles keyboard interrupt

    When an user intentionally provides an keyboard interrupt, neutronclient
    throws the entire traceback on to the terminal instead of handling it.
    neutronclient will now handle the keyboard interrrupt and provides an crisp
    message on to the terminal.

    Change-Id: I55a85cd4bfcbf26d81e5678b6f4aed3d1c288467
    Closes-Bug: #1367283

Changed in python-neutronclient:
status: In Progress → Fix Committed
Kyle Mestery (mestery)
Changed in python-neutronclient:
milestone: 2.3.9 → 2.3.10
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-keystoneclient (master)

Reviewed: https://review.openstack.org/121046
Committed: https://git.openstack.org/cgit/openstack/python-keystoneclient/commit/?id=5000a851d8f08c2bc6e1f8db1576a9d51abfebf7
Submitter: Jenkins
Branch: master

commit 5000a851d8f08c2bc6e1f8db1576a9d51abfebf7
Author: Rakesh H S <email address hidden>
Date: Fri Sep 12 15:46:28 2014 +0530

    handles keyboard interrupt

    When an user intentionally provides an keyboard interrupt, keystoneclient
    throws the entire traceback on to the terminal instead of handling it.
    keystoneclient will now handle the keyboard interrrupt and provides an crisp
    message on to the terminal.

    Change-Id: I1026d259fd0688dd2b950b1bdb135d219da2a60a
    Closes-Bug: #1367283

Changed in python-keystoneclient:
status: In Progress → Fix Committed
Changed in python-keystoneclient:
milestone: none → 1.1.0
Changed in python-keystoneclient:
status: Fix Committed → Fix Released
Akihiro Motoki (amotoki)
Changed in python-neutronclient:
status: Fix Committed → Fix Released
Changed in python-ironicclient:
milestone: none → 0.7.0
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.