Condor configuration is localized into /etc/condor/config.d/01_rocks_condor_config.local. This file is generated programatically from the output of rocks report host osg condor config <hostname>.
The command rocks report host osg condor config is defined by the OSG roll and is written in Python. This report command is extensible through Rocks command plugins.
To see a sample Condor plugin, view the file in location /opt/rocks/lib/python2.4/site-packages/rocks/commands/report/host/osg/condor/config/plugin_sample.py, which is reproduced here.
# $Id$ import rocks.commands class Plugin(rocks.commands.Plugin): def provides(self): return 'sample' def run(self, argv): # Argv contains the hostname and the in memory key-value store # that is eventually written to # /etc/condor/config.d/01_rocks_condor_config.local # plugins can add/change/remove keys from the store # 1. Get the hostname and the key-value store, which # is a python dictionary host, kvstore = argv # The following would add CONDOR_SAMPLE=Sample Plugin # the key = value dictionary (kvstore) that is written out # # Example 1. Read an attribute from the database and set # the values value = self.db.getHostAttr(host, 'Condor_HostAllow') kvstore['CONDOR_SAMPLE'] = value # Example 2. Set the key CONDOR_SAMPLE to the hostname kvstore['CONDOR_SAMPLE'] = host # Example 3. Remove a key from the dictionary if 'CONDOR_SAMPLE' in kvstore: del kvstore['CONDOR_SAMPLE'] RollName = "condor" |
Users/Roll Developers can add their own plugins for the "report host condor config" command to overwrite, add, and/or delete key,value pairs that are written into /etc/condor/config.d/01_rocks_condor_config.local.
In the above code sample, the Condor report command driver passes the hostname and the dictionary of already defined key,value pairs (kvstore in the sample code). The sample code shows several different examples of changing the key 'CONDOR_SAMPLE'.
Plugins are written in Python, are called in random order, and must be named "plugin_<name>.py".
Plugins also enable any desired configurations to be properly applied with the command rocks sync host osg condor config.