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

Re: [HTCondor-users] update node's master ClassAds through Python bindings?



Hi Thomas,

Is this running on the worker node itself or does it have to be remote?

If itâs local then the following should be enough:

import htcondor
htcondor.param[âMY_VARâ] = 5

Or RemoteParam for remote setting.

However you may be running into a security setting, especially given the remoteparam failure message.

You need to look at the SETTABLE_ATTRS_* config knobs.

Cheers, Iain

> On Aug 15, 2016, at 16:56, Thomas Hartmann <thomas.hartmann@xxxxxxx> wrote:
> 
> Hi all,
> 
> I am trying to modify settable ClassAds on a worker node's master
> through the python bindings. I.e., I would like to do something
> equivalent to
> 
>> condor_config_val -name batch0930.desy.de -master -set
> 'TEST_HOST_STATUS = "preparing"'
>> condor_reconfig -name batch0930.desy.de
> 
> 
> So, I first polled the current ClassAds from the collector for this
> node/master, change the key:value and advertise the updated ad
> 
>>>> batch0930_master =
> collector.query(htcondor.AdTypes.Master,'regexp(".*batch0930\\.desy\\.de",
> Name)')
> # in the end the idea would be a list of masters to loop over...
>>>> batch0930_master[0]['TEST_HOST_STATUS']='testing'
>>>> collector.advertise(batch0930_master[0],command=UPDATE_AD_MASTER)
> 
> which fails with "NameError: name 'UPDATE_AD_MASTER' is not defined" [1]
> 
> ---
> 
> I also tried to follow
> https://lists.cs.wisc.edu/archive/htcondor-users/2015-November/msg00060.shtml
> with
> 
>>>> batch0930_master = collector.locate(htcondor.DaemonTypes.Master,
> "batch0930.desy.de")
> # I assume, that the ClassAds objects are the same either queried with
> locate() or with query() [with the 'right' regexp], or?
>>>> batch0930_master['TEST_HOST_STATUS']='testing'
> 
> # apparently setting a new value before polling the remote parameters
> does not work
> # so I polled the remote parameters and tried to update the
> dict/classad with
> 
>>>> batch0930_params = htcondor.RemoteParam(batch0930_master)
>>>> batch0930_params['TEST_HOST_STATUS']='testing'
> 
> but which fails with
> "RuntimeError: Failed to set remote daemon parameter."
> 
> So, I would be grateful if somebody can help me out on how to properly
> update a worker node's master? ;)
> 
> Cheers and thanks,
>  Thomas
> 
> [1]
> the current documentation is a bit unclear, since the keyword order
> seems to be different for generic 'UPDATE_AD_GENERIC' compared to startd
> daemon 'UPDATE_STARTD_AD' as in
> https://research.cs.wisc.edu/htcondor/manual/latest/6_7Python_Bindings.html
> anyway, I tried both, 'UPDATE_AD_MASTER' and 'UPDATE_MASTER_AD', but
> both are failing with the aforementioned name error
> 
> _______________________________________________
> 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/

Attachment: smime.p7s
Description: S/MIME cryptographic signature