(self, resource, *args, **kwargs)
| 409 | display_attributes = ["name", "value"] |
| 410 | |
| 411 | def __init__(self, resource, *args, **kwargs): |
| 412 | help_text = ( |
| 413 | "Load a list of %s from file." % resource.get_plural_display_name().lower() |
| 414 | ) |
| 415 | super(KeyValuePairLoadCommand, self).__init__( |
| 416 | resource, "load", help_text, *args, **kwargs |
| 417 | ) |
| 418 | |
| 419 | self.parser.add_argument( |
| 420 | "-c", |
| 421 | "--convert", |
| 422 | action="store_true", |
| 423 | help=( |
| 424 | "Convert non-string types (hash, array, boolean," |
| 425 | " int, float) to a JSON string before loading it" |
| 426 | " into the datastore." |
| 427 | ), |
| 428 | ) |
| 429 | self.parser.add_argument( |
| 430 | "file", |
| 431 | help=( |
| 432 | "JSON/YAML file containing the %s(s) to load" |
| 433 | % resource.get_plural_display_name().lower() |
| 434 | ), |
| 435 | ) |
| 436 | |
| 437 | @resource.add_auth_token_to_kwargs_from_cli |
| 438 | def run(self, args, **kwargs): |
nothing calls this directly
no test coverage detected