From 3792cd4892a0dd1baa53cb27633ffbf93352b455 Mon Sep 17 00:00:00 2001 From: Matt Riedemann Date: Fri, 6 Nov 2015 18:51:33 -0800 Subject: [PATCH] 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 --- tempest/config.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tempest/config.py b/tempest/config.py index 0cda0181b1..94149737e4 100644 --- a/tempest/config.py +++ b/tempest/config.py @@ -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."),