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

Re: [HTCondor-users] A few questions about the format of variables (classads) and their values when using the python bindings

> On Jul 28, 2015, at 10:20 AM, Jose Caballero <jcaballero.hep@xxxxxxxxx> wrote:
>> The ClassAd library will automatically cast basic literals (strings, integers, floats, booleans, lists, dictionaries) from python to ClassAds.
> This may be very relevant too.
> Does that mean that I can pass the value of variables like maxWallTime
> both as 960 (int) and as "960" (string), and in both cases the
> classAds will handle it properly?
> I know that the C++ Condor Code handles everything as 'const char *' anywaysâ

In both cases, they will produce a valid class ad.  For example, setting the int will result in the following ad:

[maxWallTime = 960;]

versus setting the string:

[maxWallTime = â960â;]

*However*, most of the HTCondor code will not automatically cast the string â960â to the integer 960 when evaluating if it expects an integer.  While itâs a valid classad, youâll likely get an error.

So, in this case, what you most likely want is:

ad[âmaxWallTimeâ] = 960