Merge "Update hacking version"
This commit is contained in:
commit
87017c8bdc
@ -325,8 +325,8 @@ class EnvFilter(CommandFilter):
|
|||||||
user_command = userargs[len(user_envs):len(user_envs) + 1]
|
user_command = userargs[len(user_envs):len(user_envs) + 1]
|
||||||
|
|
||||||
# match first non-env argument with CommandFilter
|
# match first non-env argument with CommandFilter
|
||||||
return (super(EnvFilter, self).match(user_command)
|
return (super(EnvFilter, self).match(user_command) and
|
||||||
and len(filter_envs) and user_envs == filter_envs)
|
len(filter_envs) and user_envs == filter_envs)
|
||||||
|
|
||||||
def exec_args(self, userargs):
|
def exec_args(self, userargs):
|
||||||
args = userargs[:]
|
args = userargs[:]
|
||||||
@ -377,8 +377,8 @@ class IpNetnsExecFilter(ChainingFilter):
|
|||||||
if self.run_as != "root" or len(userargs) < 4:
|
if self.run_as != "root" or len(userargs) < 4:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
return (userargs[0] == 'ip' and userargs[1] in NETNS_VARS
|
return (userargs[0] == 'ip' and userargs[1] in NETNS_VARS and
|
||||||
and userargs[2] in EXEC_VARS)
|
userargs[2] in EXEC_VARS)
|
||||||
|
|
||||||
def exec_args(self, userargs):
|
def exec_args(self, userargs):
|
||||||
args = userargs[4:]
|
args = userargs[4:]
|
||||||
|
@ -19,15 +19,15 @@ import os
|
|||||||
import signal
|
import signal
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
if sys.platform != 'win32':
|
|
||||||
import pwd
|
|
||||||
|
|
||||||
import six
|
import six
|
||||||
from six import moves
|
from six import moves
|
||||||
|
|
||||||
from oslo_rootwrap import filters
|
from oslo_rootwrap import filters
|
||||||
from oslo_rootwrap import subprocess
|
from oslo_rootwrap import subprocess
|
||||||
|
|
||||||
|
if sys.platform != 'win32':
|
||||||
|
import pwd
|
||||||
|
|
||||||
|
|
||||||
class NoFilterMatched(Exception):
|
class NoFilterMatched(Exception):
|
||||||
"""This exception is raised when no filter matched."""
|
"""This exception is raised when no filter matched."""
|
||||||
@ -73,8 +73,8 @@ class RootwrapConfig(object):
|
|||||||
if config.has_option("DEFAULT", "syslog_log_level"):
|
if config.has_option("DEFAULT", "syslog_log_level"):
|
||||||
v = config.get("DEFAULT", "syslog_log_level")
|
v = config.get("DEFAULT", "syslog_log_level")
|
||||||
level = v.upper()
|
level = v.upper()
|
||||||
if (hasattr(logging, '_nameToLevel')
|
if (hasattr(logging, '_nameToLevel') and
|
||||||
and level in logging._nameToLevel):
|
level in logging._nameToLevel):
|
||||||
# Workaround a regression of Python 3.4.0 bug fixed in 3.4.2:
|
# Workaround a regression of Python 3.4.0 bug fixed in 3.4.2:
|
||||||
# http://bugs.python.org/issue22386
|
# http://bugs.python.org/issue22386
|
||||||
self.syslog_log_level = logging._nameToLevel[level]
|
self.syslog_log_level = logging._nameToLevel[level]
|
||||||
@ -177,8 +177,8 @@ def match_filter(filter_list, userargs, exec_dirs=None):
|
|||||||
# This command calls exec verify that remaining args
|
# This command calls exec verify that remaining args
|
||||||
# matches another filter.
|
# matches another filter.
|
||||||
def non_chain_filter(fltr):
|
def non_chain_filter(fltr):
|
||||||
return (fltr.run_as == f.run_as
|
return (fltr.run_as == f.run_as and
|
||||||
and not isinstance(fltr, filters.ChainingFilter))
|
not isinstance(fltr, filters.ChainingFilter))
|
||||||
|
|
||||||
leaf_filters = [fltr for fltr in filter_list
|
leaf_filters = [fltr for fltr in filter_list
|
||||||
if non_chain_filter(fltr)]
|
if non_chain_filter(fltr)]
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
# 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,<1.2.0 # Apache-2.0
|
||||||
|
|
||||||
fixtures>=3.0.0 # Apache-2.0/BSD
|
fixtures>=3.0.0 # Apache-2.0/BSD
|
||||||
testtools>=2.2.0 # MIT
|
testtools>=2.2.0 # MIT
|
||||||
|
3
tox.ini
3
tox.ini
@ -49,7 +49,10 @@ deps = -r{toxinidir}/doc/requirements.txt
|
|||||||
commands = sphinx-build -W -b html doc/source doc/build/html
|
commands = sphinx-build -W -b html doc/source doc/build/html
|
||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
|
# E731 skipped as assign a lambda expression
|
||||||
|
|
||||||
show-source = True
|
show-source = True
|
||||||
|
ignore = E731
|
||||||
exclude = .tox,dist,doc,*.egg,build
|
exclude = .tox,dist,doc,*.egg,build
|
||||||
|
|
||||||
[testenv:benchmark]
|
[testenv:benchmark]
|
||||||
|
Loading…
Reference in New Issue
Block a user