Comment 6 for bug 882574

Revision history for this message
Daniel Rich (drich-u) wrote :

I believe the problem is that the regexp that was added doesn't really match the output of dmidecode since the newlines make it multiline output. The following patches should fix it:

--- /usr/share/perl5/vendor_perl/Ocsinventory/Agent/Backend/OS/Generic/Dmidecode/Bios.pm.orig 2014-06-16 11:23:09.901219209 -0700
+++ /usr/share/perl5/vendor_perl/Ocsinventory/Agent/Backend/OS/Generic/Dmidecode/Bios.pm 2014-06-16 11:23:28.592457680 -0700
@@ -18,15 +18,15 @@
   $Type = `dmidecode -s chassis-type`;

   chomp($SystemModel);
- $SystemModel =~ s/^#+\s+$//g;
+ $SystemModel =~ s/^#[^\n]*\n//msg;
   chomp($SystemManufacturer);
- $SystemManufacturer =~ s/^#+\s+$//g;
+ $SystemManufacturer =~ s/^#[^\n]*\n//msg;
   chomp($SystemSerial);
- $SystemSerial =~ s/^#+\s+$//g;
+ $SystemSerial =~ s/^#[^\n]*\n//msg;
   chomp($AssetTag);
- $AssetTag =~ s/^#\s+$//g;
+ $AssetTag =~ s/^#[^\n]*\n//msg;
   chomp($Type);
- $Type =~ s/^#\s+$//g;
+ $Type =~ s/^#[^\n]*\n//msg;

   #Motherboard DMI
   $MotherboardManufacturer = `dmidecode -s baseboard-manufacturer`;

and

--- /usr/share/perl5/vendor_perl/Ocsinventory/Agent/Backend/OS/Generic/Dmidecode/UUID.pm.orig 2014-06-16 11:25:30.334009447 -0700
+++ /usr/share/perl5/vendor_perl/Ocsinventory/Agent/Backend/OS/Generic/Dmidecode/UUID.pm 2014-06-16 11:23:37.520571563 -0700
@@ -12,7 +12,7 @@

   $uuid = `dmidecode -s system-uuid`;
   chomp($uuid);
- $uuid =~ s/^#+\s+$//g;
+ $uuid =~ s/^#[^\n]*\n//msg;

    $common->setHardware({
       UUID => $uuid,