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

Re: [HTCondor-users] how to validate Collector and Schedd initilization with the python bindings?



>> For an example, see
>>   http://htcondor.org/python_notebook_examples/HOWTO_use_ping.html
>>

Hi Todd,

finally I had time to test it.
It works, but it forces me to instantiate an object collector, even if
I don't have an HTCondor's Collector running.

>>> sched = htcondor.Schedd()
>>> print len(sched.query())
11356
>>> htcondor.SecMan().ping(sched)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: No registered converter was able to produce a C++ rvalue of
type std::string from this Python object of type Schedd
>>>

You have to do something like this

>>> collector = htcondor.Collector()
>>> schedd = collector.locate(htcondor.DaemonTypes.Schedd)
>>> print len(sched.query())
11343
>>> htcondor.SecMan().ping(schedd)
[ SessionDuration = "60"; AuthMethods = "FS"; Enact = "YES"; Subsystem
= "TOOL"; ValidCommands = "60002,60003,60011,60014"; Command = 60040;
AuthMethodsList = "FS,KERBEROS,GSI"; AuthorizationSucceeded = true;
UseSession = "YES"; RemoteVersion = "$CondorVersion: 8.6.11 May 10
2018 BuildID: 440910 $"; MyRemoteUserName =
"unauthenticated@unmapped"; AuthCommand = 60011; SessionLease = 3600;
User = "unauthenticated@unmapped"; Integrity = "NO"; Authentication =
"NO"; Sid = "gridui17:14411:1528233800:149444"; CryptoMethods =
"3DES,BLOWFISH"; ServerTime = 1528233800; OutgoingNegotiation =
"PREFERRED"; Encryption = "NO" ]

even though

>>> htcondor.SecMan().ping(collector)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: No registered converter was able to produce a C++ rvalue of
type std::string from this Python object of type Collector
>>>


OK. It works, but feels weird to me :)
Anyways, thanks for the hint.
Cheers,
Jose