(self, arg_parser, parsed_alias_args)
| 288 | setattr(parsed_globals, param_name, updated_param_value) |
| 289 | |
| 290 | def _get_global_parameters_to_update(self, arg_parser, parsed_alias_args): |
| 291 | # Retrieve a list of global parameters that the newly parsed args |
| 292 | # from the alias will have to clobber from the originally provided |
| 293 | # parsed globals. |
| 294 | global_params_to_update = [] |
| 295 | for parsed_param, value in vars(parsed_alias_args).items(): |
| 296 | # To determine which parameters in the alias were global values |
| 297 | # compare the parsed alias parameters to the default as |
| 298 | # specified by the parser. If the parsed values from the alias |
| 299 | # differs from the default value in the parser, |
| 300 | # that global parameter must have been provided in the alias. |
| 301 | if arg_parser.get_default(parsed_param) != value: |
| 302 | if parsed_param in self.UNSUPPORTED_GLOBAL_PARAMETERS: |
| 303 | raise InvalidAliasException( |
| 304 | 'Global parameter "--%s" detected in alias "%s" ' |
| 305 | 'which is not supported in subcommand aliases.' |
| 306 | % (parsed_param, self._alias_name) |
| 307 | ) |
| 308 | else: |
| 309 | global_params_to_update.append(parsed_param) |
| 310 | return global_params_to_update |
| 311 | |
| 312 | |
| 313 | class ServiceAliasCommand(BaseInternalAliasCommand): |
no test coverage detected