Skip to content

Commit

Permalink
[ConvertToJson] bugfix GLIDEIN Memory
Browse files Browse the repository at this point in the history
  • Loading branch information
cronosnull committed Jun 11, 2020
1 parent e65cbfd commit 0b282b0
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions src/htcondor_es/convert_to_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -1336,6 +1336,9 @@ def bulk_convert_ad_data(ad, result):
elif key in bool_vals:
value = bool(value)
elif key in int_vals:
if repr(value) == "'GLIDEIN_MaxMemMBs'":
_glidein_maxmem = ad.get("GLIDEIN_MaxMemMBs", None)
value = int(_glidein_maxmem) if _glidein_maxmem is not None else None
try:
value = int(value)
except ValueError:
Expand All @@ -1356,18 +1359,10 @@ def bulk_convert_ad_data(ad, result):
try:
value = int(value)
except ValueError:
if repr(value) == "'GLIDEIN_MaxMemMBs'":
_glidein_maxmem = ad.get("GLIDEIN_MaxMemMBs", None)
value = (
int(_glidein_maxmem)
if _glidein_maxmem is not None
else None
)
else:
logging.warning(
"Failed to convert key %s with value %s to int for a date field"
% (key, repr(value))
)
logging.warning(
"Failed to convert key %s with value %s to int for a date field"
% (key, repr(value))
)
value = None
# elif key in date_vals:
# value = datetime.datetime.fromtimestamp(value).strftime("%Y-%m-%d %H:%M:%S")
Expand Down

0 comments on commit 0b282b0

Please sign in to comment.