diff options
author | Jenkins <jenkins@review.openstack.org> | 2013-06-14 01:25:17 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2013-06-14 01:25:17 +0000 |
commit | 0630d9d817f8868b0cdcde89ac237f0411da3dff (patch) | |
tree | d4a88b81247a069b6dc7b88cae4fc5151ce38b74 /bin | |
parent | a78207e574f569ed1f3bf9c5eeb4ab523f2d5916 (diff) | |
parent | 648d3b76bec723b24a5cbf1309e06117bdd1a980 (diff) | |
download | neutron-0630d9d817f8868b0cdcde89ac237f0411da3dff.tar.gz |
Merge "xenapi: fix rootwrap"
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/quantum-rootwrap-xen-dom0 | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/bin/quantum-rootwrap-xen-dom0 b/bin/quantum-rootwrap-xen-dom0 index f4e6d2fc45..159a44657a 100755 --- a/bin/quantum-rootwrap-xen-dom0 +++ b/bin/quantum-rootwrap-xen-dom0 @@ -55,6 +55,7 @@ def load_configuration(exec_name, config_file): config = ConfigParser.RawConfigParser() config.read(config_file) try: + exec_dirs = config.get("DEFAULT", "exec_dirs").split(",") filters_path = config.get("DEFAULT", "filters_path").split(",") section = 'XENAPI' url = config.get(section, "xenapi_connection_url") @@ -74,10 +75,11 @@ def load_configuration(exec_name, config_file): url=url, username=username, password=password, + exec_dirs=exec_dirs, ) -def filter_command(exec_name, filters_path, user_args): +def filter_command(exec_name, filters_path, user_args, exec_dirs): # Add ../ to sys.path to allow running from branch possible_topdir = os.path.normpath(os.path.join(os.path.abspath(exec_name), os.pardir, os.pardir)) @@ -88,7 +90,8 @@ def filter_command(exec_name, filters_path, user_args): # Execute command if it matches any of the loaded filters filters = wrapper.load_filters(filters_path) - filter_match = wrapper.match_filter(filters, user_args) + filter_match = wrapper.match_filter( + filters, user_args, exec_dirs=exec_dirs) if not filter_match: print "Unauthorized command: %s" % ' '.join(user_args) sys.exit(RC_UNAUTHORIZED) @@ -110,7 +113,7 @@ def run_command(url, username, password, user_args): def main(): exec_name, config_file, user_args = parse_args() config = load_configuration(exec_name, config_file) - filter_command(exec_name, config['filters_path'], user_args) + filter_command(exec_name, config['filters_path'], user_args, config['exec_dirs']) return run_command(config['url'], config['username'], config['password'], user_args) |