diff options
author | Takashi NATSUME <natsume.takashi@lab.ntt.co.jp> | 2019-03-01 15:44:30 +0900 |
---|---|---|
committer | Takashi NATSUME <natsume.takashi@lab.ntt.co.jp> | 2019-03-01 15:52:22 +0900 |
commit | a306395d745a60de679a4d95983786dd104bcefc (patch) | |
tree | 8e2abff11cdf1c8b15a62775db6de4aeb49a9c75 | |
parent | a966e2c3f0f6d698f82fbc5d0509e67f03e47243 (diff) | |
download | python-novaclient-a306395d745a60de679a4d95983786dd104bcefc.tar.gz |
Remove unnecessary if statement
The interface_list method of
the novaclient.v2.server.Server class always returns
an object of the novaclient.base.ListWithMeta class
which is a sub class of list.
So 'if' statement that check whether it is an instance of list
is not necessary when printing the return value of the method.
Change-Id: I5dc5bfc6a783bb59c3aec2cce626bb00de633754
-rw-r--r-- | novaclient/v2/shell.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/novaclient/v2/shell.py b/novaclient/v2/shell.py index 4f65237d..c848521a 100644 --- a/novaclient/v2/shell.py +++ b/novaclient/v2/shell.py @@ -4524,10 +4524,10 @@ def do_interface_list(cs, args): server = _find_server(cs, args.server) res = server.interface_list() - if isinstance(res, list): - # The "tag" field is in the response starting with microversion 2.70. - show_tag = cs.api_version >= api_versions.APIVersion('2.70') - _print_interfaces(res, show_tag=show_tag) + + # The "tag" field is in the response starting with microversion 2.70. + show_tag = cs.api_version >= api_versions.APIVersion('2.70') + _print_interfaces(res, show_tag=show_tag) @utils.arg('server', metavar='<server>', help=_('Name or ID of server.')) |