[debian-edu-commits] debian-edu/ 01/01: ldap-tools/sitesummary2ldapdhcp: Apply patch from Petter Reinholdtsen to make the script work with old and new output of ifconfig.

Wolfgang Schweer schweer-guest at moszumanska.debian.org
Thu Dec 8 18:23:04 UTC 2016


This is an automated email from the git hooks/post-receive script.

schweer-guest pushed a commit to branch master
in repository debian-edu-config.

commit 36d1bde9316e0569b36d47fa866fe64758d42290
Author: Wolfgang Schweer <wschweer at arcor.de>
Date:   Thu Dec 8 19:22:04 2016 +0100

    ldap-tools/sitesummary2ldapdhcp: Apply patch from Petter Reinholdtsen to make the script work with old and new output of ifconfig.
---
 debian/changelog                |  2 ++
 ldap-tools/sitesummary2ldapdhcp | 20 +-------------------
 2 files changed, 3 insertions(+), 19 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index ec5a845..6e61482 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,8 @@ debian-edu-config (1.920) UNRELEASED; urgency=medium
   * cf/cf.homes: Adjust akonadi configuration file location. Thanks Petter.
   * Remove workarounds from Debian-custom/001-ltsp-settings as #839154 and
     #840667 have been fixed in ltsp-server 5.5.9-1.
+  * ldap-tools/sitesummary2ldapdhcp: Apply patch from Petter Reinholdtsen
+    to make the script work with old and new output of ifconfig.
 
  -- Wolfgang Schweer <wschweer at arcor.de>  Mon, 05 Dec 2016 13:26:34 +0100
 
diff --git a/ldap-tools/sitesummary2ldapdhcp b/ldap-tools/sitesummary2ldapdhcp
index 4c6f02b..71a62b3 100644
--- a/ldap-tools/sitesummary2ldapdhcp
+++ b/ldap-tools/sitesummary2ldapdhcp
@@ -82,7 +82,7 @@ sub host_handler {
     my $hostid = shift;
     my $ipaddr = SiteSummary::get_primary_ip_address($hostid);
     my $fqdn = scalar gethostbyaddr(inet_aton($ipaddr), AF_INET);
-    my $macref = [(get_ether_hwaddr($hostid))];
+    my $macref = [(SiteSummary::get_macaddresses($hostid))];
 
     # Update MAC and IP if name has been changed
     if ($fqdn && $fqdn !~ m/^auto-mac-/) {
@@ -100,24 +100,6 @@ sub host_handler {
     }
 }
 
-sub get_ether_hwaddr {
-    my $hostid = shift;
-    my $path = get_filepath_current($hostid, "/system/ifconfig-a");
-    if (open(FILE, "<", $path)) {
-        my $sysinfo = 0;
-        my @hwaddr = ();
-        while (<FILE>) {
-            chomp;
-            if (m/Link encap:Ethernet  HWaddr (.+\S)\s*$/) {
-                push(@hwaddr, $1);
-            }
-        }
-        close(FILE);
-        return @hwaddr;
-    } else {
-        return undef;
-    }
-}
 sub get_primary_ether_hwaddr {
     # FIXME How to handle several MAC addresses?
     my $macref = shift;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/debian-edu-config.git



More information about the debian-edu-commits mailing list