Feature #2548

Netblock fact

Added by Maciej Bliziński almost 3 years ago. Updated over 2 years ago.

Status:Closed Start date:08/17/2009
Priority:Normal Due date:
Assignee:Paul Nasrat % Done:

0%

Category:library
Target version:1.5.7
Keywords:network Affected Facter version:
Branch:
Votes: 0

Description

A netblock fact would display per-interface netblocks. For example:

netblock_bge0 => 172.26.168.0/23
netblock_lo0 => 127.0.0.0/8

Netblocks would be derived from ipaddress and netmask facts. I’m attaching a proposed patch. It’s missing support for a generic (primary?) netblock fact, similar to the primary ipaddress fact.

0001-Basic-netblock-support-no-tests.patch - A proposed patch (3.2 kB) Maciej Bliziński, 08/18/2009 10:52 am

ip_test.rb - Unit tests for the network fact. (2.3 kB) Maciej Bliziński, 08/24/2009 02:24 pm

History

Updated by Paul Nasrat almost 3 years ago

  • Assignee set to Paul Nasrat

Can you use rake mail_patches to mail to list for review, I’ve some basic feedback as I’m working on improving ip facts anyway.

Updated by Paul Nasrat almost 3 years ago

  • Status changed from Unreviewed to Accepted
  • Target version set to 1.6.0

Updated by Paul Nasrat over 2 years ago

  • Status changed from Accepted to In Topic Branch Pending Review

We already have a network_ fact that does this.:

ruby -Ilib bin/facter | grep network_ network_en1 => 172.17.0.0 network_lo0 => 127.0.0.0 network_vmnet1 => 192.168.235.0 network_vmnet8 => 192.168.162.0

Updated by Paul Nasrat over 2 years ago

I’ve added a test for the network fact utility function.

Updated by Paul Nasrat over 2 years ago

  • Status changed from In Topic Branch Pending Review to Ready For Checkin

Updated by Paul Nasrat over 2 years ago

commit:9515a40

Updated by Paul Nasrat over 2 years ago

  • Status changed from Ready For Checkin to Closed

Updated by Maciej Bliziński over 2 years ago

I had written the tests as well, and was trying to figure out how to plug them into the existing tests. Here’s what I had, if it’s useful.

Updated by Paul Nasrat over 2 years ago

  • Target version changed from 1.6.0 to 1.5.7

Also available in: Atom PDF