From 030e38c5e417339e147c39af53828ba08fb8355e Mon Sep 17 00:00:00 2001 From: Robert Rati <rrati@redhat.com> Date: Wed, 27 Apr 2011 09:55:38 -0500 Subject: [PATCH 04/13] Fixed bugs in read_condor_config. If multiple params are passed in, but no subsystem was provided, then only the last param was looked up. If multiple params are passed in and a subsystem is provided, then only the last param would attempt to lookup the param name without a subsystem. --- module/readconfig.py | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-) diff --git a/module/readconfig.py b/module/readconfig.py index c7c6fbc..42da2da 100644 --- a/module/readconfig.py +++ b/module/readconfig.py @@ -41,11 +41,16 @@ def read_condor_config(subsys, attr_list, environ={}): found = True config[attr.lower()] = value.strip() - if found == False: - (rcode, value, stderr) = run_cmd('condor_config_val ' + attr, environ=environ) - if rcode == 0: - found = True - config[attr.lower()] = value.strip() + if found == False: + # Try the param name by itself + (rcode, value, stderr) = run_cmd('condor_config_val ' + attr, environ=environ) + if rcode == 0: + found = True + config[attr.lower()] = value.strip() + else: + # The param wasn't found so break out so that an execption can + # be raised + break if found == False: # Config value not found. Raise an exception -- 1.7.6.5