Commit 97537c31 authored by Florido Paganelli's avatar Florido Paganelli

Merge branch 'master' into dev-netstat-ss-mr

parents 86560fc0 bdb07e0c
......@@ -15,6 +15,7 @@ build_forks_el6:
- ./autogen.sh
- ./configure
- yum-builddep nordugrid-arc.spec -y
- ./configure
- echo "Run make"
- make
- echo "Run make check"
......@@ -39,6 +40,7 @@ build_forks_el7:
- ./autogen.sh
- CXXFLAGS=-std=c++11 ./configure
- yum-builddep nordugrid-arc.spec -y
- CXXFLAGS=-std=c++11 ./configure
- echo "Run make"
- make
- echo "Run make check"
......@@ -62,6 +64,7 @@ build_forks_deb9:
- ./autogen.sh
- ./configure
- apt build-dep nordugrid-arc -y
- ./configure
- echo "6.0.0">VERSION
- cp $CI_PROJECT_DIR/debian/changelog.deb $CI_PROJECT_DIR/debian/changelog
- sed -i 's/trunk-1/6.0.0-1/g' $CI_PROJECT_DIR/debian/changelog
......@@ -90,6 +93,7 @@ make_debs_deb9:
- ./autogen.sh
- ./configure
- apt-get build-dep nordugrid-arc -y
- ./configure
- echo "Preparing and running dpkg-buildpackage"
- cp $CI_PROJECT_DIR/debian/changelog.deb $CI_PROJECT_DIR/debian/changelog
- echo "6.0.0">VERSION
......@@ -116,6 +120,7 @@ make_rpms_el6:
- ./autogen.sh
- ./configure
- yum-builddep nordugrid-arc.spec -y
- ./configure
- echo "Preparing and running rpmbuild"
- mkdir -p $CI_PROJECT_DIR/rpmbuild/{SOURCES,BUILD,RPMS,SRPMS}
- echo "%_topdir $CI_PROJECT_DIR/rpmbuild" > ~/.rpmmacros
......@@ -147,6 +152,7 @@ make_rpms_el7:
- ./autogen.sh
- ./configure
- yum-builddep nordugrid-arc.spec -y
- ./configure
- echo "Preparing and running rpmbuild"
- mkdir -p $CI_PROJECT_DIR/rpmbuild/{SOURCES,BUILD,RPMS,SRPMS}
- echo "%_topdir $CI_PROJECT_DIR/rpmbuild" > ~/.rpmmacros
......
......@@ -4,6 +4,9 @@
[GitLab quick-action keywords that could be useful to fill this merge request](https://source.coderefinery.org/help/user/project/quick_actions)
## Link to Bugzilla ticket
BUGZ-<ticket-id>
## Labels
#### ARC component labels - when no issue
......
......@@ -21,6 +21,12 @@ Or a combination of these, example with several issues:
```
Short description of work (#10, Fixes #1, Fixes #4).
```
## Link to Bugzilla ticket
BUGZ-<ticket-id>
Closing, Fixing keywords do not work.
## Labels
If you don't have labels available from the drop-down menu, you can specify the labels using syntax in bottom of the description:
/label ~foo ~"bar baz"
......
......@@ -99,6 +99,7 @@ namespace Arc {
};
job["DataStaging"].NewChild("nordugrid-adl:DelegationID") = delegationId;
job.GetXML(product);
return true;
}
SubmissionStatus SubmitterPluginREST::Submit(const std::list<JobDescription>& jobdescs, const std::string& endpoint, EntityConsumer<Job>& jc, std::list<const JobDescription*>& notSubmitted) {
......
......@@ -357,8 +357,8 @@ sub confchecktripel($$$) {
elsif ($block eq "arex" and $name eq "controldir") {
if (! -d $value) {
w("$value: control directory ($name) does not exist\n");
} elsif (!permcheck($value,0755,0777)) {
e("$value: directory ($name) should be 755\n");
} elsif (!permcheck($value,0755,0777) and !permcheck($value,0700,0777)) {
e("$value: directory ($name) should be 755 or 700\n");
}
}
......@@ -638,7 +638,7 @@ Return error if the presence of one value implies one of another
sub check_completeness() {
my $config=shift;
my @required=("common", "arex", "cluster", "lrms");
my @required=("arex", "cluster", "lrms");
my ($validparams, $validblocks, $multiple, $novalueparams) = validconfparams();
......
......@@ -119,21 +119,37 @@ def get_rte_path(sw):
rte_path = None
if os.path.exists('%s/rte/enabled/%s' % (Config.controldir, sw)):
rte_path = '%s/rte/enabled/%s' % (Config.controldir, sw)
elif os.path.exists('%s/rte/default/%s' % (Config.controldir, sw)):
rte_path = '%s/rte/default/%s' % (Config.controldir, sw)
else:
warn('Requested RunTimeEnvironment %s is missing or not enabled.' % (sw), 'common.submit')
return rte_path
def get_rte_params_path(sw):
rte_params_path = None
if os.path.exists('%s/rte/params/%s' % (Config.controldir, sw)):
rte_params_path = '%s/rte/params/%s' % (Config.controldir, sw)
return rte_params_path
# include optional params file to the RTE file content
def get_rte_content(sw):
rte_path = get_rte_path(sw)
if not rte_path:
return ""
rte_params_path = get_rte_params_path(sw)
rte_content = ''
if rte_params_path:
try:
with open(rte_params_path, 'r') as f:
rte_content += f.read()
except IOError:
pass
try:
with open(rte_path, 'r') as f:
return f.read()
except:
return ""
rte_content += f.read()
except IOError:
pass
return rte_content
# Limitation: In RTE stage 0, scripts MUST use the 'export' command if any
......@@ -304,9 +320,7 @@ class JobscriptAssembler(object):
"""
return self._stubs.get(stub, '')
def __init__(self, jobdesc):
self.jobdesc = jobdesc
self._stubs = {}
self._ignore = []
......@@ -359,14 +373,12 @@ class JobscriptAssembler(object):
self._setup_runtime_env()
self._parse()
def __getitem__(self, item):
return self.map.get(item, '')
def __setitem__(self, item, value):
self.map[item] = value
def _parse(self):
PARSE = 0
......
......@@ -29,8 +29,6 @@ pkgdatadir="$basedir"
if [ -z "$1" ] ; then echo "Argument missing" 1>&2 ; exit 1 ; fi
GMKICK=${pkglibexecdir}/gm-kick
# Prints the uid of the owner of the file given as argument
# Perl is used because it's more portable than using the stat command
printuid () {
......@@ -144,7 +142,6 @@ for control_dir in "$@" ; do
debug "got exitcode=$exitcode"
save_commentfile "$uid" "${joboption_directory}.comment" "${control_dir}/job.${job}.errors"
echo "$exitcode $comment" > "${control_dir}/job.${job}.lrms_done"
"${GMKICK}" -j "${job}" "${control_dir}/job.${job}.local"
done
done
......
......@@ -411,7 +411,7 @@ job_write_donefile() {
echo "${LRMSExitcode:--1} $msg" > $donefile || log "failed writing file: $PWD/$donefile"
# wake up GM
"${pkglibexecdir}/gm-kick" -j "$gridid" "job.$gridid.local"
"${pkglibexecdir}/gm-kick" "job.$gridid.local"
}
#
......
......@@ -248,9 +248,10 @@ done
# Kick the GM
if [ -n "${kicklist[*]}" ];then
for ind in "${kicklist[@]}";do
"${pkglibexecdir}/gm-kick" -j "${gridids[$ind]}" "${basenames[$ind]}.status"
done
"${pkglibexecdir}/gm-kick" \
$(for ind in "${kicklist[@]}";do
echo "${basenames[$ind]}.status"
done | xargs)
fi
exit 0
......@@ -211,19 +211,19 @@ do
job_write_diag
${GMKICK} -j "${jobid}" "$jobfile"
${GMKICK} "$jobfile"
continue
fi
# job finished and exit code is known
save_commentfile "$uid" "${sessiondir}.comment" "$errorsfile"
echo "$exitcode Executable finished with exit code $exitcode" >> "$donefile"
${GMKICK} -j "${jobid}" "$jobfile"
${GMKICK} "$jobfile"
continue
fi
exitcode=-1
save_commentfile "$uid" "${sessiondir}.comment" "$errorsfile"
echo "$exitcode Job finished with unknown exit code" >> "$donefile"
${GMKICK} -j "${jobid}" "$jobfile"
${GMKICK} "$jobfile"
done
if [ ! -z "$perflogdir" ]; then
......
......@@ -185,7 +185,7 @@ for ctr_dir in $control_dir ; do
# job finished and exit code is known
save_commentfile "$uid" "${sessiondir}.comment" "${ctr_dir}/job.${gridid}.errors"
echo "$exitcode Executable finished with exit code $exitcode" > "$donefile"
${GMKICK} -j "${gridid}" "$jobfile"
${GMKICK} "$jobfile"
continue
fi
fi
......@@ -203,7 +203,7 @@ for ctr_dir in $control_dir ; do
rm -f "$countfile"
save_commentfile "$uid" "${sessiondir}.comment" "${ctr_dir}/job.${gridid}.errors"
echo "$exitcode Job was lost with unknown exit code" > "$donefile"
${GMKICK} -j "${gridid}" "$jobfile"
${GMKICK} "$jobfile"
else
echo "$counter" > "$countfile"
fi
......
......@@ -168,7 +168,6 @@ process_log_file () {
base_name=`echo "$name" 2>/dev/null | sed -n 's/\.local$//p'`
if [ -z "${base_name}" ] ; then continue ; fi
gridid=`echo "$base_name" 2>/dev/null | sed -n 's/.*\.\([^\.]*\)$/\1/'`
# check if job already reported
if [ -f "${base_name}.lrms_done" ] ; then continue ; fi
......@@ -282,7 +281,7 @@ process_log_file () {
fi
fi
# wake up GM
${GMKICK} -j "${gridid}" "${base_name}.local"
${GMKICK} "${base_name}.local"
done
IFS=$old_IFS
}
......@@ -415,7 +414,7 @@ for ctr_dir in "$@" ; do
# job finished and exit code is known
save_commentfile "$uid" "${session}.comment" "${ctr_dir}/job.${gridid}.errors"
echo "$exitcode Executable finished with exit code $exitcode" > "$donefile"
${GMKICK} -j "$gridid" "$jobfile"
${GMKICK} "$jobfile"
echo "Job $gridid finished with exit code $exitcode"
continue
fi
......@@ -432,7 +431,7 @@ for ctr_dir in "$@" ; do
rm -f "$countfile"
save_commentfile "$uid" "${session}.comment" "${ctr_dir}/job.${gridid}.errors"
echo "$exitcode Job was lost with unknown exit code" > "$donefile"
${GMKICK} -j "$gridid" "$jobfile"
${GMKICK} "$jobfile"
echo "Job $gridid finished with unknown exit code"
else
echo "$counter" > "$countfile"
......
......@@ -266,7 +266,7 @@ add_accounting_to_diag () {
handle_failedcode "$failedcode" "$donefile" "$exitcode" "$sgeexitcode" "$overlimit"
# wake up GM
$GMKICK -j "${gridid}" "$localfile" >> "$errorsfile"
$GMKICK "$localfile" >> "$errorsfile"
rm -f "$countfile"
rm -f "$diagfile_tmp" "$diagfile_acct"
......@@ -307,7 +307,7 @@ handle_missing_accounting () {
echo "$exitcode Job failed with exit code $exitcode" > "$donefile"
fi
$GMKICK -j "${gridid}" "$localfile" >> "$errorsfile"
$GMKICK "$localfile" >> "$errorsfile"
return
fi
......@@ -342,7 +342,7 @@ handle_missing_accounting () {
rm -f "$countfile"
# wake up GM
$GMKICK -j "${gridid}" "$localfile" >> "$errorsfile"
$GMKICK "$localfile" >> "$errorsfile"
else
# test again for job existence, only count if not known
......
......@@ -408,10 +408,10 @@ fi
# Kick the GM
if [ -n "${kicklist[*]}" ];then
for localid in "${kicklist[@]}";do
gridid=`echo "${basenames[$localid]}" | sed 's/.*\.\([^\.]*\)$/\1/'`
"${pkglibexecdir}/gm-kick" -j "${gridid}" "${basenames[$localid]}.local"
done
"${pkglibexecdir}/gm-kick" \
$(for localid in "${kicklist[@]}";do
echo "${basenames[$localid]}.local"
done | xargs)
fi
exit 0
#@IgnoreInspection BashAddShebang
######################################################
#Common functions for submit scripts
######################################################
......@@ -278,10 +279,17 @@ RTE_include_default () {
}
RTE_path_set () {
rte_params_path="${CONFIG_controldir}/rte/params/${rte_name}"
if [ ! -f "$rte_params_path" ]; then
rte_params_path=""
fi
rte_path="${CONFIG_controldir}/rte/enabled/${rte_name}"
if [ ! -f "$rte_path" ]; then
echo "ERROR: Requested RunTimeEnvironment ${rte_name} is missing or not enabled." 1>&2
exit 1
rte_path="${CONFIG_controldir}/rte/default/${rte_name}"
if [ ! -f "$rte_path" ]; then
echo "ERROR: Requested RunTimeEnvironment ${rte_name} is missing or not enabled." 1>&2
exit 1
fi
fi
}
......@@ -310,6 +318,7 @@ RTE_to_jobscript () {
# add RTE script content as a function into the job script
echo "# RunTimeEnvironment function for ${rte_name}:" >> $LRMS_JOB_SCRIPT
echo "RTE_function_${rte_idx} () {" >> $LRMS_JOB_SCRIPT
[ -n "${rte_params_path}" ] && cat "${rte_params_path}" >> $LRMS_JOB_SCRIPT
cat "${rte_path}" >> $LRMS_JOB_SCRIPT
echo "}" >> $LRMS_JOB_SCRIPT
# next RTE
......
......@@ -179,12 +179,12 @@ controldir=\"`pwd`/controldir\"" ${test}.arc.conf
fi
jobs_not_kicked=""
for job in ${expected_kicked_jobs}; do
if test $(grep -c "^${job}\$" gm_kick_test_file) == 0; then
if test $(grep -c "/job.${job}.local" gm_kick_test_file) == 0; then
jobs_not_kicked="${jobs_not_kicked}"$'\n'"${job}"
continue
fi
# Remove first occurance of job in kick list.
sed -i "0,/^${job}\$/ {/^${job}\$/ d}" gm_kick_test_file
sed -i "0,/\/job.${job}.local/ {/\/job.${job}.local/ d}" gm_kick_test_file
done
if test ! -z "${jobs_not_kicked}"; then
echo -n "F"
......@@ -198,7 +198,7 @@ controldir=\"`pwd`/controldir\"" ${test}.arc.conf
if test "$(wc -w gm_kick_test_file | cut -f 1 -d ' ')" -gt 0; then
echo -n "F"
exitCode=$((exitCode + 1))
errorOutput="$errorOutput"$'\n\n'"Test fail in test_${test}:"$'\n'"The following jobs was unexpectedly kicked:"$'\n'"$(sed 's#^# #' gm_kick_test_file)"
errorOutput="$errorOutput"$'\n\n'"Test fail in test_${test}:"$'\n'"The following jobs was unexpectedly kicked:"$'\n'"$(sed 's#.*/job.\(.*\).local$# \1#' gm_kick_test_file)"
goToParentAndRemoveDir ${testdir}
continue
fi
......
......@@ -4,14 +4,4 @@ if test ! -f "${GM_KICK_TEST_FILE}"; then
GM_KICK_TEST_FILE=gm_kick_test_file
fi
isid='0'
for arg in $@; do
if [ "$isid" = '0' ] ; then
if [ "$arg" = "-j" ] ; then
isid='1'
fi
else
echo "$arg" >> ${GM_KICK_TEST_FILE}
isid='0'
fi
done
printf "%s\n" "$@" >> ${GM_KICK_TEST_FILE}
# description: copy proxy certificate to the job session directory
# param:COPY_CACERT_DIR:Yes,No:Yes:If set to Yes, CA certificate dir will be copied to the session directory along with proxy certificate
COPY_CACERT_DIR="${COPY_CACERT_DIR:-Yes}"
X509_CERT_DIR="${X509_CERT_DIR:-/etc/grid-security/certificates}"
if [ "x$1" = "x0" ]; then
mkdir -pv ${joboption_directory}/arc/certificates/
cp -rv ${X509_CERT_DIR}/* ${joboption_directory}/arc/certificates/
if [ "x$COPY_CACERT_DIR" = "xYes" ]; then
mkdir -pv ${joboption_directory}/arc/certificates/
cp -rv ${X509_CERT_DIR}/* ${joboption_directory}/arc/certificates/
fi
GM_JOBS="${ARC_LOCATION:-@prefix@}/@pkglibexecsubdir@/gm-jobs"
$GM_JOBS -J -S -D ${joboption_gridid} -o "${joboption_directory}/user.proxy"
if [ $? != 0 ]; then
......@@ -14,5 +18,7 @@ if [ "x$1" = "x0" ]; then
elif [ "x$1" = "x1" ]; then
export X509_USER_PROXY="${RUNTIME_JOB_DIR}/user.proxy"
export X509_USER_CERT="${RUNTIME_JOB_DIR}/user.proxy"
export X509_CERT_DIR="${RUNTIME_JOB_DIR}/arc/certificates"
if [ "x$COPY_CACERT_DIR" = "xYes" ]; then
export X509_CERT_DIR="${RUNTIME_JOB_DIR}/arc/certificates"
fi
fi
import os
import logging
from arc.utils import config
logger = logging.getLogger('ARCCTL.Common')
......@@ -20,6 +21,15 @@ except ImportError:
ARC_DATA_DIR = ARC_LOCATION + '/share/arc/'
def get_parsed_arcconf(config_file):
try:
config.parse_arc_conf(config_file)
arcconf = config
except IOError:
arcconf = None
return arcconf
class ComponentControl(object):
""" Common abstract class to ensure all implicit calls to methods are defined """
def control(self, args):
......
from ControlCommon import *
from arc.utils import config
import subprocess
import sys
import re
......@@ -8,20 +7,12 @@ import time
def complete_job_owner(prefix, parsed_args, **kwargs):
try:
config.parse_arc_conf(parsed_args.config)
arcconf = config
except IOError:
arcconf = None
arcconf = get_parsed_arcconf(parsed_args.config)
return JobsControl(arcconf).complete_owner(parsed_args)
def complete_job_id(prefix, parsed_args, **kwargs):
try:
config.parse_arc_conf(parsed_args.config)
arcconf = config
except IOError:
arcconf = None
arcconf = get_parsed_arcconf(parsed_args.config)
return JobsControl(arcconf).complete_job(parsed_args)
......@@ -173,9 +164,10 @@ class JobsControl(ComponentControl):
def kill_or_clean(self, args, action='-k'):
self.__get_jobs()
self.__job_exists(args.jobid)
for jobid in args.jobid:
self.__job_exists(jobid)
__JOB_RE = re.compile(r'^Job:\s*')
gmjobs_out = self.__run_gmjobs('-J -S ' + action + ' ' + args.jobid)
gmjobs_out = self.__run_gmjobs('-J -S ' + action + ' ' + ' '.join(args.jobid))
for line in iter(gmjobs_out.stdout.readline, ''):
if __JOB_RE.match(line):
sys.stdout.write(line)
......@@ -310,9 +302,6 @@ class JobsControl(ComponentControl):
jobs_log.add_argument('-s', '--service', help='Show ARC CE logs containing the jobID instead of job log',
action='store_true')
jobs_kill = jobs_actions.add_parser('kill', help='Cancel job')
jobs_kill.add_argument('jobid', help='Job ID').completer = complete_job_id
jobs_info = jobs_actions.add_parser('info', help='Show job main info')
jobs_info.add_argument('jobid', help='Job ID').completer = complete_job_id
......@@ -320,12 +309,15 @@ class JobsControl(ComponentControl):
jobs_attr.add_argument('jobid', help='Job ID').completer = complete_job_id
jobs_attr.add_argument('attr', help='Attribute name', nargs='?')
jobs_kill = jobs_actions.add_parser('kill', help='Cancel job')
jobs_kill.add_argument('jobid', nargs='*', help='Job ID').completer = complete_job_id
jobs_killall = jobs_actions.add_parser('killall', help='Cancel all jobs')
jobs_killall.add_argument('-s', '--state', help='Filter jobs by state', action='append', choices=__JOB_STATES)
jobs_killall.add_argument('-o', '--owner', help='Filter jobs by owner').completer = complete_job_owner
jobs_clean = jobs_actions.add_parser('clean', help='Clean job')
jobs_clean.add_argument('jobid', help='Job ID').completer = complete_job_id
jobs_clean.add_argument('jobid', nargs='*', help='Job ID').completer = complete_job_id
jobs_cleanall = jobs_actions.add_parser('cleanall', help='Clean all jobs')
jobs_cleanall.add_argument('-s', '--state', help='Filter jobs by state', action='append', choices=__JOB_STATES)
......
from ControlCommon import *
import sys
import re
from arc.utils import config
import fnmatch
def complete_rte_name(prefix, parsed_args, **kwargs):
try:
config.parse_arc_conf(parsed_args.config)
arcconf = config
except IOError:
arcconf = None
arcconf = get_parsed_arcconf(parsed_args.config)
if parsed_args.action == 'enable':
return RTEControl(arcconf).complete_enable()
if parsed_args.action == 'default':
......@@ -18,6 +14,22 @@ def complete_rte_name(prefix, parsed_args, **kwargs):
return RTEControl(arcconf).complete_disable()
if parsed_args.action == 'undefault':
return RTEControl(arcconf).complete_undefault()
if parsed_args.action == 'cat':
return RTEControl(arcconf).complete_all()
if parsed_args.action == 'params-get':
return RTEControl(arcconf).complete_all()
if parsed_args.action == 'params-set':
return RTEControl(arcconf).complete_all()
def complete_rte_params(prefix, parsed_args, **kwargs):
arcconf = get_parsed_arcconf(parsed_args.config)
return RTEControl(arcconf).complete_params(parsed_args.rte)
def complete_rte_params_values(prefix, parsed_args, **kwargs):
arcconf = get_parsed_arcconf(parsed_args.config)
return RTEControl(arcconf).complete_params_values(parsed_args.rte, parsed_args.parameter)
class RTEControl(ComponentControl):
......@@ -26,11 +38,17 @@ class RTEControl(ComponentControl):
if arcconfig is None:
self.logger.critical('Controlling RunTime Environments is not possible without arc.conf defined controldir')
sys.exit(1)
# define directories
self.control_rte_dir = arcconfig.get_value('controldir', 'arex').rstrip('/') + '/rte'
self.system_rte_dir = ARC_DATA_DIR.rstrip('/') + '/rte'
self.user_rte_dirs = arcconfig.get_value('runtimedir', 'arex', force_list=True)
if self.user_rte_dirs is None:
self.user_rte_dirs = []
# define internal structures to hold RTEs
self.all_rtes = {}
self.system_rtes = {}
self.user_rtes = {}
@staticmethod
def __get_dir_rtes(rtedir):
......@@ -68,7 +86,11 @@ class RTEControl(ComponentControl):
break
return description
def __get_rtes(self):
def __fetch_rtes(self):
"""Look for RTEs on the filesystem and fill the object structures"""
# run once per tool invocation
if self.all_rtes:
return
# available pre-installed RTEs
self.logger.debug('Indexing ARC defined RTEs from %s', self.system_rte_dir)
self.system_rtes = self.__get_dir_rtes(self.system_rte_dir)
......@@ -76,7 +98,6 @@ class RTEControl(ComponentControl):
self.logger.info('There are no RTEs found in ARC defined location %s', self.system_rte_dir)
# RTEs in user-defined locations
self.user_rtes = {}
for urte in self.user_rte_dirs:
self.logger.debug('Indexing user-defined RTEs from %s', urte)
rtes = self.__get_dir_rtes(urte)
......@@ -85,7 +106,6 @@ class RTEControl(ComponentControl):
self.user_rtes.update(rtes)
# all available RTEs
self.all_rtes = {}
self.all_rtes.update(self.system_rtes)
self.all_rtes.update(self.user_rtes)
......@@ -97,6 +117,39 @@ class RTEControl(ComponentControl):
self.logger.debug('Indexing default RTEs in %s', self.control_rte_dir + '/default')
self.default_rtes = self.__get_dir_rtes(self.control_rte_dir + '/default')
def __get_rte_file(self, rte):
self.__fetch_rtes()
if rte not in self.all_rtes:
self.logger.error('There is no %s RunTimeEnvironment found', rte)
sys.exit(1)
rte_file = self.all_rtes[rte]
return rte_file
def __get_rte_params_file(self, rte):
rte_params_path = self.control_rte_dir + '/params/'
rte_params_file = rte_params_path + rte
if os.path.exists(rte_params_file):
return rte_params_file
return None
def __get_rte_list(self, rtes):
rte_list = []
for r in rtes:
if r in self.all_rtes:
# filename match goes directly to list
rte_list.append(r)
else:
# check for glob wildcards in rte name
for irte in self.all_rtes.keys():
if fnmatch.fnmatch(irte, r):
self.logger.debug('Glob wildcard match for %s RTE, adding to the list.', irte)
rte_list.append