)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8449,"name":"Marios Andreou","email":"marios.andreou@gmail.com","username":"marios"},"change_message_id":"e4f8468627ee26b2a0d09fa4e0e30c89abccda50","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch adds a custom Puppet function called interface_for_ip"},{"line_number":10,"context_line":"This function will be used within the TripleO puppet implementation"},{"line_number":11,"context_line":"to help obtain the correct interface for a given IP address."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I0979f69a49052fda888277fa64ebeadc038bc778"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"7a016987_e0e4900d","line":11,"updated":"2015-06-01 09:47:24.000000000","message":"would be great to link to the tripleo review where this gets used","commit_id":"9e509563131c2b7e623f6a96ab4297fd1bd1d249"}],"lib/puppet/parser/functions/interface_for_ip.rb":[{"author":{"_account_id":360,"name":"Dan Prince","email":"dprince@redhat.com","username":"dan-prince"},"change_message_id":"a0c82acbafb9afdc1c4c2e192fd32da8686d2d3a","unresolved":false,"context_lines":[{"line_number":9,"context_line":"    if arg[0].class \u003d\u003d String"},{"line_number":10,"context_line":"      begin"},{"line_number":11,"context_line":"        ip_to_find \u003d arg[0]"},{"line_number":12,"context_line":"        interfaces \u003d lookupvar(\u0027interfaces\u0027)"},{"line_number":13,"context_line":"        interfaces.split(\u0027,\u0027).each do |interface|"},{"line_number":14,"context_line":"          interface_ip \u003d lookupvar(\"ipaddress_#{interface}\")"},{"line_number":15,"context_line":"          netmask \u003d lookupvar(\"netmask_#{interface}\")"}],"source_content_type":"text/x-ruby","patch_set":7,"id":"5afe65bd_78e33206","line":12,"updated":"2015-06-03 13:08:02.000000000","message":"The factor \u0027interfaces\u0027 returned have underscores in them instead of dashes. (So br_ex instead of br-ex). This works great with subsequent factor lookups for ip_address_br_ex but isn\u0027t what we actually want to return from this function.\n\nProbably the easiest thing to do is to query for the interfaces ourselves (via /sys/class/net maybe) and then we know the raw interface name and can return that from the function (using underscores for factor lookups though...).\n\nI didn\u0027t notice this immediately because my new interfaces were all names \u0027vlan10\u0027, \u0027vlan20\u0027, etc. (no dashes). Trying to take things a step further though and use this for some of the bridges would require this improvement.","commit_id":"1c3fb2375e2785f3339b48f5cd90a59b2d44cb29"}]}
