[Bug 1999174] [NEW] Taskflow doesn't treat boolean configuration properly

Dmitriy Rabotyagov 1999174 at bugs.launchpad.net
Thu Dec 8 19:29:14 UTC 2022


Public bug reported:

At the moment taskflow just tries to load the configuration with getting attribute from passed config and assuming it's boolean:
https://opendev.org/openstack/taskflow/src/commit/5bcac4c7d4503be8161bcf159981199e3ea89d4d/taskflow/jobs/backends/impl_zookeeper.py#L832

In fact, at least octavia does pass variables as str and not as bool.

So in case in octavia.conf you will define following:

[task_flow]
jobboard_zookeeper_ssl_options = use_ssl:True,verify_certs:False,check_compatible:False

taskflow will end up with wrong behaviour. Since
type(self._conf['check_compatible']) is str, condition `if
self._conf.get('check_compatible', True)` will be treated as true no
matter value you place, as non-empty string will always be evaluated as
True.

While with use_ssl it's not _that_ critical as default value is False,
so to disable you can simply skip defining the variable, for
verify_certs and check_compatible things are way worse.

** Affects: taskflow
     Importance: Undecided
         Status: New

** Also affects: octavia (Ubuntu)
   Importance: Undecided
       Status: New

** No longer affects: octavia (Ubuntu)

-- 
You received this bug notification because you are a member of Ubuntu
OpenStack, which is subscribed to octavia in Ubuntu.
https://bugs.launchpad.net/bugs/1999174

Title:
  Taskflow doesn't treat boolean configuration properly

Status in taskflow:
  New

Bug description:
  At the moment taskflow just tries to load the configuration with getting attribute from passed config and assuming it's boolean:
  https://opendev.org/openstack/taskflow/src/commit/5bcac4c7d4503be8161bcf159981199e3ea89d4d/taskflow/jobs/backends/impl_zookeeper.py#L832

  In fact, at least octavia does pass variables as str and not as bool.

  So in case in octavia.conf you will define following:

  [task_flow]
  jobboard_zookeeper_ssl_options = use_ssl:True,verify_certs:False,check_compatible:False

  taskflow will end up with wrong behaviour. Since
  type(self._conf['check_compatible']) is str, condition `if
  self._conf.get('check_compatible', True)` will be treated as true no
  matter value you place, as non-empty string will always be evaluated
  as True.

  While with use_ssl it's not _that_ critical as default value is False,
  so to disable you can simply skip defining the variable, for
  verify_certs and check_compatible things are way worse.

To manage notifications about this bug go to:
https://bugs.launchpad.net/taskflow/+bug/1999174/+subscriptions




More information about the Ubuntu-openstack-bugs mailing list