On Sun, Aug 14, 2011 at 9:54 PM, Haim Ashkenazi
Thanks, The gist I posted before does something similar. It’s strange though
that it has to be so difficult. Yesterday when the need came up, I thought
it would be dead easy
The issue is complicated, which is the reason that we haven’t resolved
that old ohai bug.
- The JSON data for interfaces is structured as hierarchical
attributes of the parent, which seems to make sense.
The interface has an attribute, which is an address, which has an
attribute which is a family:
Which makes us do:
|address, data| data[“family”] == “inet” } => 192.168.1.101
- However, the way our minds tend to work is:
The interface has an address of a particularly family, usually ipv4 (inet).
Because of this common need, what we tend to want is something like:
node[:network][:interfaces][:eth1][:address][:inet] => 192.168.1.101
- Which would be nicer. There is a tendency to want something like:
node[:ipaddress_eth1] or node[:ipaddress][:eth1] but these diverge
from the data hierarchy.
One desires to have a pointer syntax in JSON so that performing a
lookup in the second form (or an alternate) would provide the data
from the first. An option is to move from the first hierarchy to the
second, possibly storing data in both locations with a deprecation
message for the first for some period of time. Another option is that
we could just live with having this data in multiple locations.