Project

General

Profile

Support #21537

Double-check functions that deal with boolean ClassAd facing possible misleading behavior

Added by Lorena Lobato Pardavila 10 months ago. Updated 25 days ago.

Status:
Closed
Priority:
High
Category:
-
Target version:
Start date:
12/12/2018
Due date:
% Done:

0%

Estimated time:
Stakeholders:
Duration:

Description

Investigating #21325, we realized there are several functions that might have misleading type comparison when we are dealing with boolean attributes. These functions are used to populate the factory configuration values, which can lead to issues similar to #21325.

Some of the the possible functions to be investigated:

/usr/lib/python2.7/site-packages/glideinwms/tools/creation/lib/cWDictFile.py:    # returns a bool: True if the dir was created, false else
/usr/lib/python2.7/site-packages/glideinwms/tools/creation/lib/cWParams.py:        self.attr_defaults["parameter"]=("True", "Bool", "Should it be passed as a parameter?", None)
/usr/lib/python2.7/site-packages/glideinwms/tools/creation/lib/cWParams.py:        self.attr_defaults["glidein_publish"]=("False", "Bool", "Should it be published by the glidein? (Used only if parameter is True.)", None)
/usr/lib/python2.7/site-packages/glideinwms/tools/creation/lib/cWParams.py:        self.attr_defaults["job_publish"]=("False", "Bool", "Should the glidein publish it to the job? (Used only if parameter is True.)", None)
/usr/lib/python2.7/site-packages/glideinwms/tools/creation/lib/cWParams.py:        self.file_defaults["const"]=("True", "Bool", "Will the file be constant? If True, the file will be signed. If False, it can be modified at any time and will not be cached.", None)
/usr/lib/python2.7/site-packages/glideinwms/tools/creation/lib/cWParams.py:        self.file_defaults["executable"]=("False", 'Bool', 'Is this an executable that needs to be run in the glidein?', None)
/usr/lib/python2.7/site-packages/glideinwms/tools/creation/lib/cWParams.py:        self.file_defaults["wrapper"]=("False", 'Bool', 'Is this a wrapper script that needs to be sourced in the glidein job wrapper?', None)
/usr/lib/python2.7/site-packages/glideinwms/tools/creation/lib/cWParams.py:        self.file_defaults["untar"]=("False", 'Bool', 'Do I need to untar it? ', None)
/usr/lib/python2.7/site-packages/glideinwms/tools/creation/lib/gt2removal/cgWParams.py:        self.attr_defaults["publish"] = ("True", "Bool", "Should it be published by the factory?", None)
/usr/lib/python2.7/site-packages/glideinwms/tools/creation/lib/gt2removal/cgWParams.py:        self.attr_defaults["const"] = ("True", "Bool", "Should it be constant? (Else it can be overriden by the frontend. Used only if parameter is True.)", None)
/usr/lib/python2.7/site-packages/glideinwms/tools/creation/lib/gt2removal/cgWParams.py:        entry_config_restrictions_defaults["require_voms_proxy"]=("False", "Bool", "Whether this entry point requires a voms proxy", None)
/usr/lib/python2.7/site-packages/glideinwms/tools/creation/lib/gt2removal/cgWParams.py:        entry_config_restrictions_defaults["require_glidein_glexec_use"]=("False", "Bool", "Whether this entry requires glidein to use glexec", None)
/usr/lib/python2.7/site-packages/glideinwms/tools/creation/lib/gt2removal/cgWParams.py:        self.entry_defaults["enabled"] = ("True", "Bool", "Is this entry enabled?", None)
/usr/lib/python2.7/site-packages/glideinwms/tools/creation/lib/gt2removal/cgWParams.py:        self.defaults['factory_versioning'] = ('True', 'Bool', 'Should we create versioned subdirectories?', None)
/usr/lib/python2.7/site-packages/glideinwms/tools/creation/lib/gt2removal/cgWParams.py:        self.defaults['advertise_with_tcp'] = ('True', 'Bool', 'Should condor_advertise use TCP connections?', None)
/usr/lib/python2.7/site-packages/glideinwms/tools/creation/lib/gt2removal/cgWParams.py:        self.defaults['advertise_with_multiple'] = ('True', 'Bool', 'Should condor_advertise use -multiple?', None)
/usr/lib/python2.7/site-packages/glideinwms/tools/creation/lib/gt2removal/cgWParams.py:        stage_defaults["use_symlink"] = ("True", "Bool", "Can I symlink stage dir from submit dir?", None)
/usr/lib/python2.7/site-packages/glideinwms/tools/creation/lib/gt2removal/cgWParams.py:        monitoring_collector_defaults["secondary"]=("False", "Bool", "Secondary nodes will be used by glideins, if present", None)
/usr/lib/python2.7/site-packages/glideinwms/tools/creation/lib/gt2removal/cgWParams.py:        self.defaults["files"][3]["after_entry"] = ("False", 'Bool', 'Should this file be loaded after the entry ones?', None)

An example of these functions could be "add_extended" (cWDictFile.py), where "type" accepts as valid types: "string", "expr" and "integer" (anything different from the first 2 strings is considered integer). Although, there are several calls to this function where value is passed as "Bool" or "Boolean". These types are not a valid value but it ends up working because integers are not quoted (same as expressions), but it's not correct.

It should be 'expr'', anything that is not 'expr' or 'string' is considered integer but normally boolean variables are considered condor expressions: http://glideinwms.fnal.gov/doc.prd/factory/custom_vars.html

All these functions where "Bool" or "Boolean" are passed as parameter (and the valid types are string|int|expr) must be double-checked to avoid issues in the future


Related issues

Related to GlideinWMS - Bug #21898: Error preventing the Frontend fo match jobsClosed02/20/2019

Related to GlideinWMS - Bug #21325: Frontend not recognizing entries in downtimeClosed11/07/2018

Related to GlideinWMS - Bug #21527: The factory seems to ignore the configuration values in the files in the config.d directory w/ entry configurationsClosed12/11/2018

Related to GlideinWMS - Support #21940: Unit tests for boolean and string valuesClosed02/20/2019

Related to GlideinWMS - Bug #22354: Strings evaluated as booleanClosed04/10/2019

History

#1 Updated by Lorena Lobato Pardavila 8 months ago

  • Related to Bug #21898: Error preventing the Frontend fo match jobs added

#2 Updated by Lorena Lobato Pardavila 8 months ago

  • Related to Bug #21325: Frontend not recognizing entries in downtime added

#3 Updated by Lorena Lobato Pardavila 8 months ago

  • Related to Bug #21527: The factory seems to ignore the configuration values in the files in the config.d directory w/ entry configurations added

#4 Updated by Lorena Lobato Pardavila 8 months ago

  • Related to Bug #21898: Error preventing the Frontend fo match jobs added

#5 Updated by Lorena Lobato Pardavila 8 months ago

  • Related to deleted (Bug #21898: Error preventing the Frontend fo match jobs)

#6 Updated by Lorena Lobato Pardavila 8 months ago

  • Related to Support #21940: Unit tests for boolean and string values added

#7 Updated by Marco Mambelli 7 months ago

  • Related to Bug #22354: Strings evaluated as boolean added

#8 Updated by Marco Mambelli 4 months ago

  • Target version changed from v3_5_x to v3_5_1
  • Priority changed from Normal to High

Do we still need this?

#9 Updated by Lorena Lobato Pardavila 4 months ago

  • Status changed from New to Resolved

I don't think so as all the sub-tasks have been completed.

I am resolving the ticket.

#10 Updated by Marco Mambelli 25 days ago

  • Status changed from Resolved to Closed


Also available in: Atom PDF