Merge "Allow lower case protocol values"
This commit is contained in:
@@ -42,6 +42,10 @@ def env(*vars, **kwargs):
|
|||||||
return kwargs.get('default', '')
|
return kwargs.get('default', '')
|
||||||
|
|
||||||
|
|
||||||
|
def convert_to_uppercase(string):
|
||||||
|
return string.upper()
|
||||||
|
|
||||||
|
|
||||||
def get_client_class(api_name, version, version_map):
|
def get_client_class(api_name, version, version_map):
|
||||||
"""Returns the client class for the requested API version.
|
"""Returns the client class for the requested API version.
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
from neutronclient.common import utils
|
||||||
from neutronclient.i18n import _
|
from neutronclient.i18n import _
|
||||||
from neutronclient.neutron import v2_0 as neutronV20
|
from neutronclient.neutron import v2_0 as neutronV20
|
||||||
|
|
||||||
@@ -82,6 +83,7 @@ class CreateListener(neutronV20.CreateCommand):
|
|||||||
'--protocol',
|
'--protocol',
|
||||||
required=True,
|
required=True,
|
||||||
choices=['TCP', 'HTTP', 'HTTPS', 'TERMINATED_HTTPS'],
|
choices=['TCP', 'HTTP', 'HTTPS', 'TERMINATED_HTTPS'],
|
||||||
|
type=utils.convert_to_uppercase,
|
||||||
help=_('Protocol for the listener.'))
|
help=_('Protocol for the listener.'))
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--protocol-port',
|
'--protocol-port',
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ class CreatePool(neutronV20.CreateCommand):
|
|||||||
'--protocol',
|
'--protocol',
|
||||||
required=True,
|
required=True,
|
||||||
choices=['HTTP', 'HTTPS', 'TCP'],
|
choices=['HTTP', 'HTTPS', 'TCP'],
|
||||||
|
type=utils.convert_to_uppercase,
|
||||||
help=_('Protocol for balancing.'))
|
help=_('Protocol for balancing.'))
|
||||||
|
|
||||||
def args2body(self, parsed_args):
|
def args2body(self, parsed_args):
|
||||||
|
|||||||
Reference in New Issue
Block a user