Use choices kwarg when defining string options with defined choices

The ssh_connect_method and ssh_auth_method config options only allow
defined sets of choices, so enforce that using the choices kwarg with
StrOpt.

Change-Id: I862e1d6add8d74085987f7b86b3b8a4e67afe937
This commit is contained in:
Matt Riedemann 2015-11-06 18:51:33 -08:00
parent 113fc9fb26
commit 3792cd4892

View File

@ -255,6 +255,7 @@ ComputeGroup = [
"when sshing to a guest."),
cfg.StrOpt('ssh_auth_method',
default='keypair',
choices=('keypair', 'configured', 'adminpass', 'disabled'),
help="Auth method used for authenticate to the instance. "
"Valid choices are: keypair, configured, adminpass "
"and disabled. "
@ -264,6 +265,7 @@ ComputeGroup = [
"Disabled: avoid using ssh when it is an option."),
cfg.StrOpt('ssh_connect_method',
default='floating',
choices=('fixed', 'floating'),
help="How to connect to the instance? "
"fixed: using the first ip belongs the fixed network "
"floating: creating and using a floating ip."),