[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [HTCondor-users] Insert custom ClassAd attributes in a machine ad via a script



Haven’t used the STARTD Hooks, but the JobRouter hooks work fine. We’re also using Python scripts as hooks and they are used by HTCondor very reliably and stable.

As John said, you need key,value pairs. Try
```
# test.py
	key = "x"
	value = 50
	print ('%s = %d‘%(key, value))
```

In general, your output should be formatted the same way ClassAds from the HTCondor tools are formatted. See HTC’s ClassAd documentation[1] for details.

Cheers,
Max

[1]
http://research.cs.wisc.edu/htcondor/manual/current/4_1HTCondor_s_ClassAd.html

> Am 02.03.2015 um 21:21 schrieb John (TJ) Knoeller <johnkn@xxxxxxxxxxx>:
> 
> The output of your script needs to be a set of "key=value" pairs.
> It appears to me that youur script is outputting only
> 
> 50
> 
> which is not valid 
> 
> On 2/19/2015 12:02 AM, Nischal Bansal wrote:
>> Hi,
>>  
>> I am trying to insert a custome ClassAd attribute in machine ad via python script using below changes in condor_config
>>  
>> STATUS = C:\condor\example1\test\test.bat 
>> STARTD_CRON_JOBLIST = $(STARTD_CRON_JOBLIST) STATUS 
>> STARTD_CRON_STATUS_EXECUTABLE = $(STATUS) 
>> STARTD_CRON_STATUS_PERIOD = 60
>>  
>> I am trying a test file for the time, before using actual file
>>  
>> test.bat
>>         @echo off
>>         python test.py
>>  
>> test.py
>>         x = 50
>>         print ("%d" % x)
>>  
>> But it’s not working. 
>>  
>> Is there anyone ever tried inserting custom ClassAd attributes in a machine ad via python script & succeeded?
>>  
>>  
>> Regards
>> Nischal Bansal
>>  
>> 
>> The information contained in this e-mail and any accompanying documents may contain information that is confidential or otherwise protected from disclosure. If you are not the intended recipient of this message, please immediately alert the sender by reply e-mail and then delete this message. Any dissemination, distribution or other use of the contents of this message by anyone other than the intended recipient is strictly prohibited. R Systems has taken every reasonable precaution to minimize the risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment.
>> 
>> 
>> _______________________________________________
>> HTCondor-users mailing list
>> To unsubscribe, send a message to 
>> htcondor-users-request@xxxxxxxxxxx
>>  with a
>> subject: Unsubscribe
>> You can also unsubscribe by visiting
>> 
>> https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users
>> 
>> 
>> The archives can be found at:
>> 
>> https://lists.cs.wisc.edu/archive/htcondor-users/
> 
> <ATT00001.c>