Skip to content

Commit afa273a

Browse files
committed
Update cloudwatch.py
1 parent 83b78ba commit afa273a

1 file changed

Lines changed: 15 additions & 18 deletions

File tree

awscli/customizations/cloudwatch.py

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,23 @@
1111
# ANY KIND, either express or implied. See the License for the specific
1212
# language governing permissions and limitations under the License.
1313
from awscli.customizations.utils import make_hidden_command_alias
14-
from awscli.customizations.utils import rename_command
1514

1615

1716
def register_rename_otel_commands(event_emitter):
18-
event_emitter.register(
19-
'building-command-table.cloudwatch',
20-
rename_otel_commands
21-
)
17+
event_emitter.register(
18+
'building-command-table.cloudwatch',
19+
alias_otel_commands
20+
)
2221

2322

24-
def rename_otel_commands(command_table, **kwargs):
25-
"""Rename o-tel commands to otel, keeping o-tel as hidden aliases."""
26-
renames = {
27-
'get-o-tel-enrichment': 'get-otel-enrichment',
28-
'start-o-tel-enrichment': 'start-otel-enrichment',
29-
'stop-o-tel-enrichment': 'stop-otel-enrichment',
30-
}
31-
for old_name, new_name in renames.items():
32-
if old_name in command_table:
33-
rename_command(command_table, old_name, new_name)
34-
make_hidden_command_alias(
35-
command_table, new_name, old_name
36-
)
23+
def alias_otel_commands(command_table, **kwargs):
24+
aliases = {
25+
'get-otel-enrichment': 'get-o-tel-enrichment',
26+
'start-otel-enrichment': 'start-o-tel-enrichment',
27+
'stop-otel-enrichment': 'stop-o-tel-enrichment',
28+
}
29+
for existing_name, alias_name in aliases.items():
30+
if existing_name in command_table:
31+
make_hidden_command_alias(
32+
command_table, existing_name, alias_name
33+
)

0 commit comments

Comments
 (0)