Merge "Update hacking version to 1.1"

This commit is contained in:
Zuul
2019-02-07 17:56:55 +00:00
committed by Gerrit Code Review
6 changed files with 50 additions and 52 deletions

View File

@@ -25,7 +25,7 @@ flake8==2.5.5
future==0.16.0 future==0.16.0
futurist==1.2.0 futurist==1.2.0
greenlet==0.4.10 greenlet==0.4.10
hacking==0.12.0 hacking==1.1.0
idna==2.6 idna==2.6
imagesize==0.7.1 imagesize==0.7.1
iso8601==0.1.11 iso8601==0.1.11
@@ -68,7 +68,6 @@ paramiko==2.0.0
Paste==2.0.2 Paste==2.0.2
PasteDeploy==1.5.0 PasteDeploy==1.5.0
pbr==2.0.0 pbr==2.0.0
pep8==1.5.7
pika-pool==0.1.3 pika-pool==0.1.3
pika==0.10.0 pika==0.10.0
positional==1.2.1 positional==1.2.1

View File

@@ -39,32 +39,32 @@ class LbaasL7RuleMixin(object):
def _add_common_args(parser, is_create=True): def _add_common_args(parser, is_create=True):
parser.add_argument( parser.add_argument(
'--type', '--type',
required=is_create, required=is_create,
type=utils.convert_to_uppercase, type=utils.convert_to_uppercase,
choices=['HOST_NAME', 'PATH', 'FILE_TYPE', 'HEADER', 'COOKIE'], choices=['HOST_NAME', 'PATH', 'FILE_TYPE', 'HEADER', 'COOKIE'],
help=_('Rule type.')) help=_('Rule type.'))
parser.add_argument( parser.add_argument(
'--compare-type', '--compare-type',
required=is_create, required=is_create,
type=utils.convert_to_uppercase, type=utils.convert_to_uppercase,
choices=['REGEX', 'STARTS_WITH', 'ENDS_WITH', choices=['REGEX', 'STARTS_WITH', 'ENDS_WITH',
'CONTAINS', 'EQUAL_TO'], 'CONTAINS', 'EQUAL_TO'],
help=_('Rule compare type.')) help=_('Rule compare type.'))
parser.add_argument( parser.add_argument(
'--invert-compare', '--invert-compare',
dest='invert', dest='invert',
action='store_true', action='store_true',
help=_('Invert the compare type.')) help=_('Invert the compare type.'))
parser.add_argument( parser.add_argument(
'--key', '--key',
help=_('Key to compare.' help=_('Key to compare.'
' Relevant for HEADER and COOKIE types only.')) ' Relevant for HEADER and COOKIE types only.'))
parser.add_argument( parser.add_argument(
'--value', '--value',
required=is_create, required=is_create,
help=_('Value to compare.')) help=_('Value to compare.'))
def _common_args2body(client, parsed_args, is_create=True): def _common_args2body(client, parsed_args, is_create=True):

View File

@@ -38,17 +38,16 @@ class LbaasMemberMixin(object):
def _add_common_args(parser): def _add_common_args(parser):
parser.add_argument( parser.add_argument(
'--name', '--name',
help=_('Name of the member.')) help=_('Name of the member.'))
parser.add_argument( parser.add_argument(
'--weight', '--weight',
help=_('Weight of the member in the pool (default:1, [0..256]).')) help=_('Weight of the member in the pool (default:1, [0..256]).'))
def _parse_common_args(body, parsed_args): def _parse_common_args(body, parsed_args):
neutronV20.update_dict(parsed_args, body, neutronV20.update_dict(parsed_args, body, ['weight', 'name'])
['weight', 'name'])
class ListMember(LbaasMemberMixin, neutronV20.ListCommand): class ListMember(LbaasMemberMixin, neutronV20.ListCommand):

View File

@@ -300,20 +300,20 @@ def _get_attrs(client_manager, attrs, parsed_args):
def _fill_protocol_port_info(attrs, port_type, port_val): def _fill_protocol_port_info(attrs, port_type, port_val):
min_port, sep, max_port = port_val.partition(":") min_port, sep, max_port = port_val.partition(":")
if not min_port: if not min_port:
msg = ("Invalid port value '%s', expected format is " msg = ("Invalid port value '%s', expected format is "
"min-port:max-port or min-port.") "min-port:max-port or min-port.")
raise argparse.ArgumentTypeError(msg % port_val) raise argparse.ArgumentTypeError(msg % port_val)
if not max_port: if not max_port:
max_port = min_port max_port = min_port
try: try:
attrs[port_type + '_port_range_min'] = int(min_port) attrs[port_type + '_port_range_min'] = int(min_port)
attrs[port_type + '_port_range_max'] = int(max_port) attrs[port_type + '_port_range_max'] = int(max_port)
except ValueError: except ValueError:
message = (_("Protocol port value %s must be an integer " message = (_("Protocol port value %s must be an integer "
"or integer:integer.") % port_val) "or integer:integer.") % port_val)
raise nc_exc.CommandError(message=message) raise nc_exc.CommandError(message=message)
def _get_id(client, id_or_name, resource): def _get_id(client, id_or_name, resource):

View File

@@ -110,7 +110,7 @@ class SimpleReadOnlyNeutronClientTest(base.ClientTestBase):
commands = [] commands = []
cmds_start = lines.index('Commands for API v2.0:') cmds_start = lines.index('Commands for API v2.0:')
command_pattern = re.compile('^ {2}([a-z0-9\-\_]+)') command_pattern = re.compile(r'^ {2}([a-z0-9\-\_]+)')
for line in lines[cmds_start:]: for line in lines[cmds_start:]:
match = command_pattern.match(line) match = command_pattern.match(line)
if match: if match:

View File

@@ -1,7 +1,7 @@
# The order of packages is significant, because pip processes them in the order # The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration # of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later. # process, which may cause wedges in the gate later.
hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 hacking>=1.1.0 # Apache-2.0
bandit>=1.1.0 # Apache-2.0 bandit>=1.1.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0