Comment 3 for bug 1781368

Reviewed: https://review.openstack.org/582147
Committed: https://git.openstack.org/cgit/openstack/python-novaclient/commit/?id=b13ba0138f6ee2e10ce3b4b95aee37c6cebd1f20
Submitter: Zuul
Branch: master

commit b13ba0138f6ee2e10ce3b4b95aee37c6cebd1f20
Author: zhaolihui <email address hidden>
Date: Thu Jul 12 11:12:54 2018 +0000

    Fix flavor keyerror when nova boot vm

    When creating a server (the 'nova boot' command),
    it calls 'POST /servers' API.

    The response does not have 'addresses' and 'flavor' attributes.
    When accessing 'networks' attribute in the '_print_server' function,
    it calls 'GET /servers/{server_id}' and get the 'addresses' and
    'flavor' attributes.

    If 'GET /servers/{server_id}' fails, the server object does not have
    the 'flavor' attribute, then KeyError is raised when accessing it.

    Fix the issue by making it raise a CommandError
    when the 'GET /servers/{server_id}' fails.

    Co-Authored-By: Takashi Natsume <email address hidden>
    Change-Id: I3ef096c61b0e05a637ab0c4a1027338fa87e4f09
    Closes-Bug: #1781368