Bug 190796 - Patch for sysutils/rubygem-facter to add interface alias support
Summary: Patch for sysutils/rubygem-facter to add interface alias support
Status: Closed Not Accepted
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Bartek Rutkowski
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-08 16:22 UTC by Michelle Sullivan
Modified: 2016-05-13 00:36 UTC (History)
4 users (show)

See Also:


Attachments
Diff against the port. (2.09 KB, patch)
2014-06-08 16:22 UTC, Michelle Sullivan
no flags Details | Diff
Enhanced freebsd aliases for facter (4.13 KB, patch)
2014-07-16 15:24 UTC, Daniel Siechniewicz
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michelle Sullivan 2014-06-08 16:22:22 UTC
Created attachment 143533 [details]
Diff against the port.

Patch to add interface alias support for the first 10 aliases (limited to 10 because I can't work out how to abort the loop when it gets to an alias that doesn't exist without writing a huge amount of code - which is more likely to break)

Patch has been submitted to the developer, but no idea if they will accept it as it's only a FreeBSD thing.. all other OSs are supported for aliases.

(probably would be a good idea to make it an optional patch - however I have left it as a default patch)
Comment 1 Michelle Sullivan 2014-06-08 16:24:19 UTC
Output with patch:

# facter | grep -E 'ip|alias'
ipaddress => 174.36.235.173
ipaddress_em0 => 10.24.8.72
ipaddress_em1 => 174.36.235.173
ipaddress_em1_alias0 => 208.43.110.204
ipaddress_em1_alias1 => 208.43.110.205
ipaddress_em1_alias2 => 208.43.110.206
ipaddress_em1_alias3 => 208.43.110.207
ipaddress_lo0 => 127.0.0.1
netmask_em1_alias0 => 255.255.255.0
netmask_em1_alias1 => 255.255.255.0
netmask_em1_alias2 => 255.255.255.0
netmask_em1_alias3 => 255.255.255.0

Output currently (no patch):
# facter | grep -E 'ip|alias'
ipaddress => 174.36.235.173
ipaddress_em0 => 10.24.8.72
ipaddress_em1 => 174.36.235.173
ipaddress_lo0 => 127.0.0.1
Comment 2 Michael Moll freebsd_committer freebsd_triage 2014-06-20 17:04:07 UTC
Michele, could you open a pull request on GitHub to the facter project for that and discuss it with the Puppet Labs people? It's much better to upstream patches like this.
Comment 3 Michelle Sullivan 2014-06-20 17:06:06 UTC
Already did, didn't get any reply, so make a port patch as well (FreeBSD is not very well supported with Puppet as it is)

Michelle
Comment 4 Daniel Siechniewicz 2014-07-16 15:24:53 UTC
Created attachment 144728 [details]
Enhanced freebsd aliases for facter

This is an enhanced version of the patch that adds a method to return aliases count and only iterates up to that number.
Comment 5 Daniel Siechniewicz 2014-07-16 16:22:01 UTC
Pull request for my version:

https://github.com/puppetlabs/facter/pull/731
Comment 6 Adrien Thebo 2014-07-16 21:30:33 UTC
We would be happy to pull in this patch into Facter itself, but we need a few things before we can merge the pull request. First off we need the CLA to be signed by all the contributors for the pull request. We have one on file for Daniel Siechniewicz but since Michelle Sullivan was the original author we will need Michelle to sign the CLA as well. Beyond that it would be nice to have some minor tweaks to the code in the pull request, but that'll be a straightforward matter of code review that I'm happy to help with as well.

The main point is that we have to have a CLA on file for all contributors, and once we have that we can certainly get this change merged into upstream.

Michelle, for the sake of my curiosity could you point out where you filed the original patch submission? It looks like your contribution may have slipped through the cracks and I would like to make sure this doesn't happen in the future.
Comment 7 Michelle Sullivan 2014-07-16 21:49:14 UTC
I cannot for the life of me find record of where I filed it - but I am sure (as I do with all patches against things I find in Git) will have mailed the author (as recorded in GitHub) with a copy.

What's a CLA? (Contributers License Agreement?  If so point me at it so I can sign it...  I should be in the bug system of PuppetLabs if this helps..)

I am happy for this to go into Puppet/Facter with just passing remark of me and my email (yes my email! - I collect spam ;-) ... Michelle Sullivan <michelle@sorbs.net>
Comment 8 Adrien Thebo 2014-07-16 23:19:14 UTC
Yep, the CLA is the contributor's license agreement - IANAL but my best explanation is that it grants Puppet Labs a license to use your submission, and you retain copyright on your submission (if you're concerned about that). The CLA can be signed online at https://cla.puppetlabs.com/ by using your GitHub account. Once we have that from you we can merge this contribution in and I'll make sure you're credited in the commit log.
Comment 9 Michelle Sullivan 2014-07-16 23:32:25 UTC
Done, thanks... use "Michelle Sullivan <michelle@sorbs.net>" where ever possible (don't hide/munge the email) - it's a great way of getting spammed. ;-)
Comment 10 Adrien Thebo 2014-07-16 23:37:01 UTC
Thanks much Michelle, and we'll make sure your email address is as spammable as possible! :)
Comment 11 Michael Moll freebsd_committer freebsd_triage 2015-11-09 14:31:09 UTC
I would be in favour of closing this.

The patch never arrived in upstream facter 2.x and the recent facter 3.x series is written in C++.

As this C++ implementation is missing quite some stuff for FreeBSD, I hope that somebody[tm] will implement the missing features in C++ and open PRs to the upstream Puppetlabs repo.
Comment 12 Bartek Rutkowski freebsd_committer freebsd_triage 2016-05-12 21:54:57 UTC
Closing, as this is no longer relevant.
Comment 13 Michelle Sullivan 2016-05-13 00:36:01 UTC
No longer relevant?

The patch didn't get put into the main stream, and as far as I can tell alias support on FreeBSD hasn't changed...  But I'll be honest, I haven't looked all that close to current stuff either.