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

[HTCondor-users] Extra quotes in ClassAd attribute name



Greetings,
in the GlideinWMS code I'm publishing some attributes set for HTCondor creating the attribute name automatically and I bumped into extra quotes  when publishing a ClassAd with a plus "+" in the attribute name, e.g. "GlideinSubmit+MMDB_e1_att_w_plus".
This happens only when the attribute is printed on the new classad format -which is the default in the Python API-, not in any of the other formats (see below for tests), not in the value of the Python attribute name (key of the dictionary).
And in Python binding printOld() prints the quoted attribute name, while condor_status is not.

It is a bit confusing. Is it a bug or desired feature?
If it is desired, are there other characters causing the quoting?

Thank you,
Marco

----

Below ccs is condor_status -any

# ccs -l ce-workspace.glideinwms.org@gfactory_instance@gfactory_service -long:new | grep GlideinSubm
[ AuthenticatedIdentity = "gfactory@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; ... 'GlideinSubmit+MMDB_e1_att_w_plus' = "15"; GlideinSubmitMMDB_e1_att1 = "e1_a1_val"; ... ]

# ccs -l ce-workspace.glideinwms.org@gfactory_instance@gfactory_service -long:xml | grep GlideinSubm
   <a n="GlideinSubmit+MMDB_e1_att_w_plus"><s>15</s></a>
   <a n="GlideinSubmitMMDB_e1_att1"><s>e1_a1_val</s></a>

# ccs -l ce-workspace.glideinwms.org@gfactory_instance@gfactory_service -long | grep GlideinSubm
GlideinSubmit+MMDB_e1_att_w_plus = "15"
GlideinSubmitMMDB_e1_att1 = "e1_a1_val"

# ccs -l ce-workspace.glideinwms.org@gfactory_instance@gfactory_service -long:json | grep GlideinSubm
 "GlideinSubmit+MMDB_e1_att_w_plus": "15",
 "GlideinSubmitMMDB_e1_att1": "e1_a1_val",

python3
>>> coll = htcondor.Collector("vocms0205.cern.ch")
>>> ads=coll.query(htcondor.AdTypes.Any, constraint='mytype=="glidefactory"')
>>> print(ads[-1]) #this has the quotes
    [
         ...
        'GlideinSubmit+xcount' = "8";
        ...
    ]
>>>print(ads[-1].printOld()) #still with the quotes
...
'GlideinSubmit+xcount' = "8"
...
>>> ads[-1]['GlideinSubmit+xcount'] #can get the value using the attribute as a normal string however
'8'
>>> list(ads[-1].keys()) #infact..
[... 'GlideinSubmit+xcount' ...]
>>> for k,v in ads[243].items():  print(f'{k} = {v}') #meaning we can custom print these attributes without the quotes
...
GlideinSubmit+xcount = 8
...