Unpack an argument's value from the commandline. This is part one of a two step process in handling commandline arguments. Emits the load-cli-arg event with service, operation, and parameter names. Example:: load-cli-arg.ec2.describe-instances.foo
(
session, service_name, operation_name, cli_argument, value
)
| 63 | |
| 64 | |
| 65 | def unpack_argument( |
| 66 | session, service_name, operation_name, cli_argument, value |
| 67 | ): |
| 68 | """ |
| 69 | Unpack an argument's value from the commandline. This is part one of a two |
| 70 | step process in handling commandline arguments. Emits the load-cli-arg |
| 71 | event with service, operation, and parameter names. Example:: |
| 72 | |
| 73 | load-cli-arg.ec2.describe-instances.foo |
| 74 | |
| 75 | """ |
| 76 | param_name = getattr(cli_argument, 'name', 'anonymous') |
| 77 | |
| 78 | value_override = session.emit_first_non_none_response( |
| 79 | 'load-cli-arg.%s.%s.%s' % (service_name, operation_name, param_name), |
| 80 | param=cli_argument, |
| 81 | value=value, |
| 82 | service_name=service_name, |
| 83 | operation_name=operation_name, |
| 84 | ) |
| 85 | |
| 86 | if value_override is not None: |
| 87 | value = value_override |
| 88 | |
| 89 | return value |
| 90 | |
| 91 | |
| 92 | def detect_shape_structure(param): |
no test coverage detected