diff options
| author | Pavlo Shchelokovskyy <shchelokovskyy@gmail.com> | 2022-08-05 14:03:21 +0300 |
|---|---|---|
| committer | Stephen Finucane <sfinucan@redhat.com> | 2022-09-30 11:53:00 +0100 |
| commit | ec8dba29f9f646ec05c0d6fad32b4b3aaf99f6af (patch) | |
| tree | a1589bf23ca70adf67eaf6c25003839ef2caa54a /openstackclient/compute/v2 | |
| parent | 00d8d945a1869b723b9845b3e739928a7c4da00a (diff) | |
| download | python-openstackclient-ec8dba29f9f646ec05c0d6fad32b4b3aaf99f6af.tar.gz | |
Speed up standard flavor list command
currently this command tries to fetch extra_specs for any flavor
that does not have them (which is quite usual), regardless if the
command was even asked to display them (--long) at all.
This significantly slows down this command as it makes a lot of
unnecessary REST calls, one per each flavor to fetch extra_specs for.
With this patch, client only attempts to fetch flavor extra_specs if
the user actually called the client with --long.
Change-Id: Ia36414d891a41b641d7a9a04f0a1e7d43cfee351
Story: 2010343
Task: 46484
Diffstat (limited to 'openstackclient/compute/v2')
| -rw-r--r-- | openstackclient/compute/v2/flavor.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/openstackclient/compute/v2/flavor.py b/openstackclient/compute/v2/flavor.py index 8a9eb07a..bc8f758b 100644 --- a/openstackclient/compute/v2/flavor.py +++ b/openstackclient/compute/v2/flavor.py @@ -333,7 +333,7 @@ class ListFlavor(command.Lister): # Even if server supports 2.61 some policy might stop it sending us # extra_specs. So try to fetch them if they are absent for f in data: - if not f.extra_specs: + if parsed_args.long and not f.extra_specs: compute_client.fetch_flavor_extra_specs(f) columns = ( |
