← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1839538] Re: Values expected to be bools fetched from DataSource.ds_cfg should use the util methods to support common string inputs

 

On Fri, Aug 09, 2019 at 02:14:32PM -0000, Scott Moser wrote:
> I know I've talked to Chad and Ryan before about this, but I kind of
> see the plethora of values that are accepted as bad design (my bad
> design).
> Ultimately, I'd rather deprecate and remove that functionality than
> extend it to new places.  Its just not really helpful and makes
> checking more difficult.
> I realize we're in a bad place and you're trying to make it better.  I
> think the long path to making it better is to take yaml bool for
> boolean values and complain on non-boolean values.

OK, great, I'm not a huge fan of the multiple values thing either!
(That said, I do think that relying on people to know what YAML bools
are in 2019 is a lot more reasonable than it would have been back in
2012, so I don't know that this was bad design at the time!)

So I'm going to mark this as Invalid.  A brief search around didn't find
a bug for the removal/migration of those values; do you know if we
already have one, or shall I file one?

(I cannot resist this pun: I'm a strong {1, "on", "true", "yes"} on this
as the long-term plan.)


** Changed in: cloud-init
       Status: New => Invalid

** Changed in: cloud-init
       Status: Invalid => Won't Fix

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1839538

Title:
  Values expected to be bools fetched from DataSource.ds_cfg should use
  the util methods to support common string inputs

Status in cloud-init:
  Won't Fix

Bug description:
  At the moment, there are some places where we do something along the
  lines of `bool_thing = self.ds_cfg.get("cfg_option", False)`.  This is
  incorrect, because specifying anything other than the empty string in
  configuration (such as "no" or "false") will result in a True-ish
  value.

  A rough audit suggests the following places have this problem:

  cloudinit/sources/DataSourceDigitalOcean.py:43:        self.use_ip4LL = self.ds_cfg.get('use_ip4LL', MD_USE_IPV4LL)
  cloudinit/sources/DataSourceAzure.py:503:                self.ds_cfg.get('apply_network_config')):
  cloudinit/sources/DataSourceAzure.py:682:                                 preserve_ntfs=self.ds_cfg.get(
  cloudinit/sources/DataSourceAzure.py:702:            if self.ds_cfg.get('apply_network_config'):

  (This audit was just done with grep, so will have missed any places
  where ds_cfg is referred to as anything but self.ds_cfg.)

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1839538/+subscriptions


References