python-openstackclient/openstackclient/tests/unit/compute/v2
Matt Riedemann 752a2db332 Optimize _prep_server_detail to avoid redundant find_resource
When showing a server or doing a rebuild, we already have
the latest version of the server so _prep_server_detail
getting the server again is an unnecessary performance hit.

ShowServer is pretty obvious here. For RebuildServer, the
compute API actually refreshes the server before returning
it in the response, so the client already gets the latest
when the rebuild call returns.

The only other usage of _prep_server_detail that does require
a refresh is CreateServer since the POST /servers response is
a minimal version of the server object.

This adds a new refresh kwarg, backward compatible by default,
to _prep_server_detail but changes ShowServer and RebuildServer
to no longer refresh.

Change-Id: Ib1c9c424ed1cafc2dfd8be90af8de8a774bdfbf0
2018-06-08 11:46:29 -04:00
..
__init__.py move unit tests to new "unit" test module 2016-09-08 15:19:50 -07:00
fakes.py Fix limits show command without Nova and Cinder 2018-04-03 00:47:00 -07:00
test_agent.py move unit tests to new "unit" test module 2016-09-08 15:19:50 -07:00
test_aggregate.py Support "--no" option in aggregate set 2016-09-24 15:59:13 +08:00
test_console.py Use public and unified method get_console_url() 2017-02-14 03:22:03 +00:00
test_flavor.py Overwrite/Clear Flavor property 2017-02-13 15:16:09 +00:00
test_host.py Re-implement novaclient bits removed in 10.0 2018-03-13 09:10:45 -05:00
test_hypervisor.py Add --long option and more columns to the hypervisor list command 2016-10-27 04:33:47 -07:00
test_hypervisor_stats.py move unit tests to new "unit" test module 2016-09-08 15:19:50 -07:00
test_keypair.py Use flake8-import-order plugin 2017-08-17 06:55:00 +00:00
test_server.py Optimize _prep_server_detail to avoid redundant find_resource 2018-06-08 11:46:29 -04:00
test_server_backup.py Replace 'MagicMock' with 'Mock' 2016-09-14 17:59:31 +08:00
test_server_event.py Add server event list and show commands 2017-03-07 15:25:43 +08:00
test_server_group.py Remove hard-coded policy choices for creating a server group 2017-11-19 18:45:28 -05:00
test_server_image.py Replace 'MagicMock' with 'Mock' 2016-09-14 17:59:31 +08:00
test_service.py Replace 'MagicMock' with 'Mock' 2016-09-14 17:59:31 +08:00
test_usage.py Use flake8-import-order plugin 2017-08-17 06:55:00 +00:00