Commit 0e514b8

Jeff McCune
1 parent ae34893 commit 0e514b8
File tree
5 files changed
+82
-12
lines changed- lib/facter
- util
- spec
- fixtures/unit/ipaddress
- unit
5 files changed
+82
-12
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
22 | 22 |
| |
23 | 23 |
| |
24 | 24 |
| |
| 25 | + | |
| 26 | + | |
25 | 27 |
| |
26 | 28 |
| |
27 | 29 |
| |
28 | 30 |
| |
29 |
| - | |
30 |
| - | |
31 |
| - | |
32 |
| - | |
33 |
| - | |
34 |
| - | |
35 |
| - | |
36 |
| - | |
37 |
| - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
38 | 35 |
| |
39 |
| - | |
40 |
| - | |
41 |
| - | |
| 36 | + | |
42 | 37 |
| |
43 | 38 |
| |
44 | 39 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
96 | 96 |
| |
97 | 97 |
| |
98 | 98 |
| |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
99 | 107 |
| |
100 | 108 |
| |
101 | 109 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + |
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + |
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + |
2 commit comments
jgn commentedon Mar 15, 2013
I've been trying to isolate a problem on one of my systems, and the refactoring here for linux seems wrong.
Here is the documentation (at http://docs.puppetlabs.com/facter/1.6/core_facts.html#ipaddress):
Here is an example of the output from my ifconfig command:
Notice that the value of ipaddress that is supposed to be captured is:
10.0.222.20
Now look at the refactoring of the
ipaddress
fact for Linux.BEFORE, it split the output and checked every line for a regexp match; and then ignored matches for the loop back address (127...).
AFTER, there is no split.
This means that ONLY the first match would EVER be considered. There is no way that the refactored code can get to the inet address on venet0:1 (in my example).
Here's an example irb session following the code:
You will see this failure more clearly if you add another fixture for ipconfig output (for example, used what I've pasted in above).
In your fixture, the very first interface has a non-127.0.0.1 address. Here's the fixture:
jeffmccune commentedon Mar 20, 2013
@jgn Thanks for taking the time to troubleshoot this issue. Would you mind submitting a pull request that fixes this problem for you? If not, could you file an issue at http://projects.puppetlabs.com/projects/facter and add me as a watcher?
Thanks,
-Jeff