Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 5 additions & 0 deletions .changes/next-release/bugfix-cloudwatch-5230.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "bugfix",
"category": "``cloudwatch``",
"description": "Rename ``get-o-tel-enrichment``, ``start-o-tel-enrichment``, and ``stop-o-tel-enrichment`` commands to ``get-otel-enrichment``, ``start-otel-enrichment``, and ``stop-otel-enrichment``. The old names are kept as hidden aliases for backward compatibility."
}
7 changes: 0 additions & 7 deletions .changes/next-release/cloudwatch-otel-rename.json

This file was deleted.

24 changes: 9 additions & 15 deletions awscli/customizations/cloudwatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,20 @@
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
from awscli.customizations.utils import make_hidden_command_alias
from awscli.customizations.utils import rename_command


def register_rename_otel_commands(event_emitter):
event_emitter.register(
'building-command-table.cloudwatch',
rename_otel_commands
'building-command-table.cloudwatch', alias_otel_commands
)


def rename_otel_commands(command_table, **kwargs):
"""Rename o-tel commands to otel, keeping o-tel as hidden aliases."""
renames = {
'get-o-tel-enrichment': 'get-otel-enrichment',
'start-o-tel-enrichment': 'start-otel-enrichment',
'stop-o-tel-enrichment': 'stop-otel-enrichment',
def alias_otel_commands(command_table, **kwargs):
aliases = {
'get-otel-enrichment': 'get-o-tel-enrichment',
'start-otel-enrichment': 'start-o-tel-enrichment',
'stop-otel-enrichment': 'stop-o-tel-enrichment',
}
for old_name, new_name in renames.items():
if old_name in command_table:
rename_command(command_table, old_name, new_name)
make_hidden_command_alias(
command_table, new_name, old_name
)
for existing_name, alias_name in aliases.items():
if existing_name in command_table:
make_hidden_command_alias(command_table, existing_name, alias_name)