|
11 | 11 | # ANY KIND, either express or implied. See the License for the specific |
12 | 12 | # language governing permissions and limitations under the License. |
13 | 13 | from awscli.customizations.utils import make_hidden_command_alias |
14 | | -from awscli.customizations.utils import rename_command |
15 | 14 |
|
16 | 15 |
|
17 | 16 | 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 | + ) |
22 | 21 |
|
23 | 22 |
|
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