Skip to content

Commit

Permalink
Merge branch '2.2.x' into 2.3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Gonéri Le Bouder committed May 26, 2012
2 parents 9c4914e + 614b37c commit 7401d8b
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Changes
Expand Up @@ -4,7 +4,7 @@ Revision history for FusionInventory agent
General:
* various UTF8 encoding fixes

2.2.1
2.2.1 Thu, 24 May 2012 14:39:50 +0200
General:
* failure encoding with UTF8 content when using Fusion protocol (#1663)
* wrong CSS path (#1580)
Expand Down
2 changes: 2 additions & 0 deletions Makefile.PL
Expand Up @@ -27,6 +27,7 @@ recommends 'Compress::Zlib' => undef;
recommends 'HTTP::Daemon' => undef;
recommends 'Net::CUPS' => 0.60;
recommends 'IO::Socket::SSL' => undef;
recommends 'LWP::Protocol::https' => undef;

if ($OSNAME ne 'MSWin32') {
recommends 'Proc::Daemon' => undef;
Expand All @@ -47,6 +48,7 @@ test_requires 'Test::Exception' => undef;
test_requires 'Test::MockModule' => undef;
test_requires 'Test::More' => '0.93'; # subtest
test_requires 'YAML' => undef;
test_requires 'LWP::Protocol::https' => undef;

install_script 'fusioninventory-agent';
install_script 'fusioninventory-win32-service' if $OSNAME eq 'MSWin32';
Expand Down
Expand Up @@ -35,8 +35,7 @@ sub _getCPUsFromProc {
foreach my $cpu (getCPUsFromProc(@_)) {
push @cpus, {
ARCH => 'ARM',
TYPE => $cpu->{processor},
SPEED => $cpu->{bogomips}
TYPE => $cpu->{processor}
};
}

Expand Down
Expand Up @@ -53,10 +53,10 @@ sub doInventory {
$cpu->{THREAD} = $procList->[$cpt]{THREAD};
}

# Get directly informations from cpuinfo if not already processed in dmidecode
$cpu->{STEPPING} = $procList->[$cpt]{STEPPING} unless $cpu->{STEPPING} ;
$cpu->{FAMILYNUMBER} = $procList->[$cpt]{FAMILYNUMBER} unless $cpu->{FAMILYNUMBER};
$cpu->{MODEL} = $procList->[$cpt]{MODEL} unless $cpu->{MODEL};
# Get directly informations from cpuinfo if not already processed in dmidecode
$cpu->{STEPPING} = $procList->[$cpt]{STEPPING} unless $cpu->{STEPPING} ;
$cpu->{FAMILYNUMBER} = $procList->[$cpt]{FAMILYNUMBER} unless $cpu->{FAMILYNUMBER};
$cpu->{MODEL} = $procList->[$cpt]{MODEL} unless $cpu->{MODEL};

if ($cpu->{NAME} =~ /([\d\.]+)s*(GHZ)/i) {
$cpu->{SPEED} = {
Expand Down
Expand Up @@ -11,7 +11,7 @@ sub isEnabled {
# Avoid duplicated entry with libvirt
return if canRun('virsh');

return
return
canRun('qemu') ||
canRun('kvm') ||
canRun('qemu-kvm');
Expand All @@ -27,14 +27,14 @@ sub doInventory {
logger => $logger, command => 'ps -ef'
)) {
# match only if an qemu instance
next unless
next unless
$process->{CMD} =~ /(qemu|kvm|qemu-kvm) .* -([fhsv]d[a-d]|cdrom)/x;

my $name;
my $mem = 0;
my $uuid;
my $vmtype = $1;

my @options = split (/-/, $process->{CMD});
foreach my $option (@options) {
if ($option =~ m/^(?:[fhsv]d[a-d]|cdrom) (\S+)/) {
Expand All @@ -47,12 +47,12 @@ sub doInventory {
$uuid = $1;
}
}

if ($mem == 0 ) {
# Default value
$mem = 128;
}

$inventory->addEntry(
section => 'VIRTUALMACHINES',
entry => {
Expand Down
Expand Up @@ -184,6 +184,19 @@ sub _getStatus {
}
return $result if $result;

# OpenVZ
if (-f '/proc/self/status') {
my $handle = getFileHandle(
file => '/proc/self/status',
logger => $logger
);
while (my $line = <$handle>) {
my ( $varID, $varValue ) = split( ":", $line );
$result = "Virtuozzo" if ( $varID eq 'envID' && $varValue > 0 );
}
}
return $result if $result;

return 'Physical';
}

Expand Down
2 changes: 1 addition & 1 deletion lib/FusionInventory/Agent/Task/Inventory/Inventory.pm
Expand Up @@ -69,7 +69,7 @@ my %fields = (
VMID MAC COMMENT OWNER/ ],
LOGICAL_VOLUMES => [ qw/LV_NAME VGN_AME ATTR SIZE LV_UUID SEG_COUNT
VG_UUID/ ],
PHYSICAL_VOLUMES => [ qw/DEVICE PV_PE_COUNT PV_UUID FORMAT ATTR
PHYSICAL_VOLUMES => [ qw/DEVICE PV_PE_COUNT PV_UUID FORMAT ATTR
SIZE FREE PE_SIZE VG_UUID/ ],
VOLUME_GROUPS => [ qw/VG_NAME PV_COUNT LV_COUNT ATTR SIZE FREE VG_UUID
VG_EXTENT_SIZE/ ],
Expand Down
2 changes: 0 additions & 2 deletions t/inventory/linux/cpu.t
Expand Up @@ -234,14 +234,12 @@ my %arm = (
'linux-armel-1' => [
{
ARCH => 'ARM',
SPEED => '593.10',
TYPE => 'XScale-80219 rev 0 (v5l)'
}
],
'linux-armel-2' => [
{
ARCH => 'ARM',
SPEED => '1192.75',
TYPE => 'Feroceon 88FR131 rev 1 (v5l)'
}
]
Expand Down
2 changes: 1 addition & 1 deletion t/inventory/linux/lvm.t
Expand Up @@ -5,7 +5,7 @@ use warnings;

use Test::More;

use FusionInventory::Agent::Task::Inventory::Input::Linux::LVM;
use FusionInventory::Agent::Task::Inventory::Input::Linux::LVM;

my %lvs = (
'linux-1' => [
Expand Down

0 comments on commit 7401d8b

Please sign in to comment.