Puppet must cast to string values

Bug #1455611 reported by Mike Scherbakov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Invalid
High
Sergey Vasilenko
7.0.x
Invalid
High
Sergey Vasilenko
8.0.x
Invalid
High
Sergey Vasilenko

Bug Description

Please take a look at Bug #1454708. While the bug itself is fixed now, the solution is not reliable. Developers & deployment engineers, as humans, can modify yaml at any given point of time without knowing that any value has to be quoted.

I understand that python code will always put values in quotas, but it doesn't yet mean that fuel-qa code will do it, or any other human modification in place will follow the rule.

Can we instead ensure that puppet does cast to string?

Tags: area-library
Changed in fuel:
importance: Undecided → Medium
milestone: none → 7.0
status: New → Confirmed
Revision history for this message
Dmitry Ilyin (idv1985) wrote :

Actually it's a Hiera bug. It should cast non-structure values to strings. Perhaps the same can happen with symbol values too.

Dmitry Ilyin (idv1985)
Changed in fuel:
assignee: Fuel Library Team (fuel-library) → Dmitry Ilyin (idv1985)
Revision history for this message
Aleksandr Didenko (adidenko) wrote :

It's not Puppet or Hiera bug, it's how ruby YAML interprets unquoted numbers like 08:00:27:32:56:08. Just run this simple test:

echo 'mac: 08:00:27:32:56:08' > /tmp/zzz.yaml
ruby -e "require 'yaml'; puts YAML.load_file('/tmp/zzz.yaml').inspect"

Result:
{"mac"=>1960347}

So the only way to change this behaviour is to change it in ruby "yaml" library. Marking bug as invalid for Fuel.

Revision history for this message
Mike Scherbakov (mihgen) wrote :

I agree that mac has to be passed as a string. If it's passed as a number, then it is an issue indeed.

Revision history for this message
Sergey Vasilenko (xenolog) wrote :

I disagree with it:

> So the only way to change this behaviour is to change it in ruby "yaml" library.
> Marking bug as invalid for Fuel.

If we quote this value in the yaml file -- ruby will interpretate this value as text

# echo "mac: '08:00:27:32:56:08'" > /tmp/zzz.yaml
# ruby -e "require 'yaml'; puts YAML.load_file('/tmp/zzz.yaml').inspect"
{"mac"=>"08:00:27:32:56:08"}

Revision history for this message
Sebastian Kalinowski (prmtl) wrote :

Sergey, you reassigned, confirmed and rised priority of this bug, but you didn't wrote what exactly you expect form fuel-python to do in this case.

Revision history for this message
Aleksandr Didenko (adidenko) wrote :

Sergey, please read the bug description, the thing that you want has been fixed already in https://bugs.launchpad.net/fuel/+bug/1454708. This bug is about default behavior when key value is not quoted. I'm closing this bug as Invalid again.

Dmitry Pyzhov (dpyzhov)
tags: added: area-library
Dmitry Pyzhov (dpyzhov)
Changed in fuel:
milestone: 7.0 → 8.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.