Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Count more accurately
  • Loading branch information
jiasli committed Jun 29, 2020
commit 32108ad903196122206e0f538c9984111affba89
12 changes: 8 additions & 4 deletions src/azure-cli-core/azure/cli/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ def _update_command_table_from_modules(args, command_modules=None):

count = 0
cumulative_elapsed_time = 0
cumulative_group_count = 0
cumulative_command_count = 0
logger.debug("Loading command modules:")
logger.debug(self.header_mod)

Expand All @@ -216,6 +218,8 @@ def _update_command_table_from_modules(args, command_modules=None):
len(module_group_table), len(module_command_table))
count += 1
cumulative_elapsed_time += elapsed_time
cumulative_group_count += len(module_group_table)
cumulative_command_count += len(module_command_table)
except Exception as ex: # pylint: disable=broad-except
# Changing this error message requires updating CI script that checks for failed
# module loading.
Expand All @@ -227,7 +231,7 @@ def _update_command_table_from_modules(args, command_modules=None):
# Summary line
logger.debug(self.item_format_string,
"Total ({})".format(count), cumulative_elapsed_time,
len(self.command_group_table), len(self.command_table))
cumulative_group_count, cumulative_command_count)

def _update_command_table_from_extensions(ext_suppressions, extension_modname=None):

Expand Down Expand Up @@ -537,12 +541,12 @@ def invalidate(self):
"""Invalidate the command index.

This function MUST be called when installing or updating extensions. Otherwise, when an extension
1. overrides a built-in command, or
2. extends an existing command group,
1. overrides a built-in command, or
2. extends an existing command group,
the command or command group will only be loaded from the command modules as per the stale command index,
making the newly installed extension be ignored.

This function can be called when removing extensions and updating cloud profiles for double insurance.
This function can be called when removing extensions.
"""
self.INDEX[self._COMMAND_INDEX_VERSION] = ""
self.INDEX[self._COMMAND_INDEX_CLOUD_PROFILE] = ""
Expand Down