@@ -38,34 +38,34 @@ def get_resource_group_from_config(config: ConfigParser) -> str:
38
38
39
39
40
40
def get_batch_systems_from_config (config : ConfigParser ) -> str :
41
- batch_systems = []
41
+ batch_systems = set ()
42
42
43
43
siteinfo_batch_systems = config .get ("Site Information" , "batch_systems" , fallback = None )
44
44
if siteinfo_batch_systems is not None :
45
45
# Site Information.batch_systems specified -- this one wins
46
46
split_batch_systems = utilities .split_comma_separated_list (siteinfo_batch_systems )
47
47
for batch_system in split_batch_systems :
48
48
try :
49
- batch_systems .append (BATCH_SYSTEMS_CASE_MAP [batch_system .lower ()])
49
+ batch_systems .add (BATCH_SYSTEMS_CASE_MAP [batch_system .lower ()])
50
50
except KeyError :
51
51
raise SettingError ("Unrecognized batch system %s" % batch_system )
52
52
else :
53
53
# Add each batch system that's enabled from the sections in the 20-*.ini files.
54
54
for batch_system in BATCH_SYSTEMS :
55
55
if batch_system in config :
56
56
if config .getboolean (section = batch_system , option = "enabled" , fallback = None ):
57
- batch_systems .append (batch_system )
57
+ batch_systems .add (batch_system )
58
58
59
59
# Special case: BOSCO (see SOFTWARE-3720); use the BOSCO.batch argument.
60
60
if config .getboolean ("BOSCO" , "enabled" , fallback = False ):
61
61
bosco_batch = config .get ("BOSCO" , "batch" , fallback = None )
62
62
if bosco_batch :
63
63
try :
64
- batch_systems .append (BATCH_SYSTEMS_CASE_MAP [bosco_batch .lower ()])
64
+ batch_systems .add (BATCH_SYSTEMS_CASE_MAP [bosco_batch .lower ()])
65
65
except KeyError :
66
66
raise SettingError ("Unrecognized batch system %s in Bosco section" % bosco_batch )
67
67
68
- return utilities .classad_quote ("," .join (batch_systems ))
68
+ return utilities .classad_quote ("," .join (sorted ( batch_systems ) ))
69
69
70
70
71
71
def get_resource_catalog_from_config (config : ConfigParser ) -> str :
0 commit comments