Page MenuHomePhabricator

Horizon hiera UI: investigate data type handling
Closed, ResolvedPublic

Description

I'm pretty sure that in the 'guided' mode all hiera values or params are interpreted as strings, including e.g. true and false.

I'm told that it might work properly in the yaml UI but I need to double-check.

Details

Related Gerrit Patches:
openstack/horizon/deploy : trainUpdate wmf-puppet-dashboard submodule
openstack/horizon/wmf-puppet-dashboard : trainpuppet_config: detect some parameter types
openstack/horizon/wmf-puppet-dashboard : masterpuppet_config: detect some parameter types
openstack/horizon/wmf-puppet-dashboard : trainpuppet_config: detect some parameter types

Event Timeline

Andrew claimed this task.Jan 22 2020, 3:46 PM
Andrew created this task.
Andrew added a comment.Feb 6 2020, 8:55 PM

I've confirmed that the behavior with the yaml-based UI is correct. For the guided interface, strings are unquoted and non-string types (numbers, booleans, etc.) are quoted. weird.

This is happening because yaml.safe_dump() (and yaml.dump()) does some weird arbitrary quoting of things:

>>> testdict
{'role::puppetmaster::standalone::autosign': 'True', 'role::puppetmaster::standalone::command_broadcast': 'false', 'role::puppetmaster::standalone::puppetdb_host': 'blahblah', 'role::puppetmaster::standalone::git_sync_minutes': '11', 'role::labs::lvm::mnt::mount_point': '/arbitrarier'}
>>> 
>>> 
>>> yaml.dump(testdict)
"{'role::labs::lvm::mnt::mount_point': /arbitrarier, 'role::puppetmaster::standalone::autosign': 'True',\n  'role::puppetmaster::standalone::command_broadcast': 'false', 'role::puppetmaster::standalone::git_sync_minutes': '11',\n  'role::puppetmaster::standalone::puppetdb_host': blahblah}\n"

In theory specifying default_style=None should stop it quoting things, but it doesn't.

Change 570741 had a related patch set uploaded (by Andrew Bogott; owner: Andrew Bogott):
[openstack/horizon/wmf-puppet-dashboard@train] puppet_config: detect some parameter types

https://gerrit.wikimedia.org/r/570741

Change 570748 had a related patch set uploaded (by Andrew Bogott; owner: Andrew Bogott):
[openstack/horizon/wmf-puppet-dashboard@master] puppet_config: detect some parameter types

https://gerrit.wikimedia.org/r/570748

Change 570741 abandoned by Andrew Bogott:
puppet_config: detect some parameter types

Reason:
this should be a cherry pick

https://gerrit.wikimedia.org/r/570741

Change 570748 merged by Andrew Bogott:
[openstack/horizon/wmf-puppet-dashboard@master] puppet_config: detect some parameter types

https://gerrit.wikimedia.org/r/570748

Change 570914 had a related patch set uploaded (by Andrew Bogott; owner: Andrew Bogott):
[openstack/horizon/wmf-puppet-dashboard@train] puppet_config: detect some parameter types

https://gerrit.wikimedia.org/r/570914

Change 570914 merged by Andrew Bogott:
[openstack/horizon/wmf-puppet-dashboard@train] puppet_config: detect some parameter types

https://gerrit.wikimedia.org/r/570914

Change 570915 had a related patch set uploaded (by Andrew Bogott; owner: Andrew Bogott):
[openstack/horizon/deploy@train] Update wmf-puppet-dashboard submodule

https://gerrit.wikimedia.org/r/570915

Change 570915 merged by Andrew Bogott:
[openstack/horizon/deploy@train] Update wmf-puppet-dashboard submodule

https://gerrit.wikimedia.org/r/570915

Mentioned in SAL (#wikimedia-operations) [2020-02-07T16:01:58Z] <andrew@deploy1001> Started deploy [horizon/deploy@bc777d6]: Fix for T243422

CDanis removed a subscriber: CDanis.Feb 7 2020, 4:02 PM

Mentioned in SAL (#wikimedia-operations) [2020-02-07T16:05:43Z] <andrew@deploy1001> Finished deploy [horizon/deploy@bc777d6]: Fix for T243422 (duration: 03m 45s)

Andrew closed this task as Resolved.Feb 7 2020, 4:17 PM

This is quite a bit better now.