|
36 | 36 | from openstackclient.i18n import _ |
37 | 37 |
|
38 | 38 |
|
| 39 | +CONTAINER_CHOICES = ["ami", "ari", "aki", "bare", "docker", "ova", "ovf"] |
39 | 40 | DEFAULT_CONTAINER_FORMAT = 'bare' |
40 | 41 | DEFAULT_DISK_FORMAT = 'raw' |
41 | 42 | DISK_CHOICES = ["ami", "ari", "aki", "vhd", "vmdk", "raw", "qcow2", "vhdx", |
@@ -84,8 +85,12 @@ def get_parser(self, prog_name): |
84 | 85 | "--container-format", |
85 | 86 | default=DEFAULT_CONTAINER_FORMAT, |
86 | 87 | metavar="<container-format>", |
87 | | - help=_("Image container format " |
88 | | - "(default: %s)") % DEFAULT_CONTAINER_FORMAT, |
| 88 | + choices=CONTAINER_CHOICES, |
| 89 | + help=(_("Image container format. " |
| 90 | + "The supported options are: %(option_list)s. " |
| 91 | + "The default format is: %(default_opt)s") % |
| 92 | + {'option_list': ', '.join(CONTAINER_CHOICES), |
| 93 | + 'default_opt': DEFAULT_CONTAINER_FORMAT}) |
89 | 94 | ) |
90 | 95 | parser.add_argument( |
91 | 96 | "--disk-format", |
@@ -498,13 +503,12 @@ def get_parser(self, prog_name): |
498 | 503 | type=int, |
499 | 504 | help=_("Minimum RAM size needed to boot image, in megabytes"), |
500 | 505 | ) |
501 | | - container_choices = ["ami", "ari", "aki", "bare", "ovf"] |
502 | 506 | parser.add_argument( |
503 | 507 | "--container-format", |
504 | 508 | metavar="<container-format>", |
505 | | - help=_("Container format of image. Acceptable formats: %s") % |
506 | | - container_choices, |
507 | | - choices=container_choices |
| 509 | + choices=CONTAINER_CHOICES, |
| 510 | + help=_("Image container format. The supported options are: %s") % |
| 511 | + ', '.join(CONTAINER_CHOICES) |
508 | 512 | ) |
509 | 513 | parser.add_argument( |
510 | 514 | "--disk-format", |
|
0 commit comments