Skip to content

Commit

Permalink
Merge branch '2.2.x-without-charset-changes' into 2.3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Gonéri Le Bouder committed May 22, 2012
2 parents 2033622 + c07208b commit 711da05
Show file tree
Hide file tree
Showing 10 changed files with 150 additions and 87 deletions.
17 changes: 15 additions & 2 deletions Changes
Expand Up @@ -5,13 +5,22 @@ General:
* failure encoding with UTF8 content when using Fusion protocol (#1663)
* wrong CSS path (#1580)
* missing test suite dependency (#1575)
* improve CPU details (#1597)
* --no-category process support (#1630)
* replace IS64BIT software property with more general ARCH property (#1581)
* sync EDID parsing code with mandriva
* more EDID manufacturer codes
* various UTF8 encoding fixes

Windows:
* various encoding issues (#1550)
* network addresses collecting failure
* network addresses collecting failure (#1549)
* inventory all the KB on Win Vista/7 (#1668, #197, #706)
* Store the XML file with the local codepage (#272)

Virtualization:
* wrong character in Xen machine ID (#1562)
* additional disk emulation types for qemu and kvm support (#1630)

BSD:
* multiple network addresses per interface support (#1565)
Expand All @@ -21,13 +30,17 @@ Solaris:
* solaris container zone bug (#1586)
* sparc T3-1 CPU support (#1583)
* solaris 8/9/10 swap bug (#1577)
* sparc arch mismatch (#1573)

Linux:
* bad name for physical volumes (#1587)
* missing volume group ID (#1585)
* wrong volume group ID (#1584)
* duplicate volume groups (#1582)
* fix Lsilogic raid controller support (#1630)
* get device name from udev file content, not file name (#1630)
* get more disk informations from smartctl (#1630)
* sparc arch mismatch (#1573)
* read EDID data directly from /sys when available

2.2.0 Sat, 07 Apr 2012 18:57:49 +0200

Expand Down
2 changes: 1 addition & 1 deletion lib/FusionInventory/Agent.pm
Expand Up @@ -22,7 +22,7 @@ use FusionInventory::Agent::Tools;
use FusionInventory::Agent::Tools::Hostname;
use FusionInventory::Agent::XML::Query::Prolog;

our $VERSION = '2.2.0';
our $VERSION = '2.2.1';
our $VERSION_STRING =
"FusionInventory unified agent for UNIX, Linux and MacOSX ($VERSION)";
our $AGENT_STRING =
Expand Down
3 changes: 2 additions & 1 deletion lib/FusionInventory/Agent/HTTP/Client/OCS.pm
Expand Up @@ -8,6 +8,7 @@ use English qw(-no_match_vars);
use HTTP::Request;
use UNIVERSAL::require;
use URI;
use Encode;

use FusionInventory::Agent::Tools;
use FusionInventory::Agent::XML::Response;
Expand Down Expand Up @@ -61,7 +62,7 @@ sub send { ## no critic (ProhibitBuiltinHomonyms)
my $request_content = $message->getContent();
$logger->debug2($log_prefix . "sending message:\n $request_content");

$request_content = $self->_compress($request_content);
$request_content = $self->_compress(encode('UTF-8', $request_content));
if (!$request_content) {
$logger->error($log_prefix . 'inflating problem');
return;
Expand Down
5 changes: 3 additions & 2 deletions lib/FusionInventory/Agent/Task/Inventory/Input/MacOS/CPU.pm
Expand Up @@ -47,11 +47,12 @@ sub _getCpus{

my (%params) = @_;
my $logger = $params{logger};

my $sysctl = $params{sysctl};
# Get more informations from sysctl
my $sysctl = getFileHandle (
logger => $logger,
command => 'sysctl -a machdep.cpu'
command => 'sysctl -a machdep.cpu',
file => $sysctl
);

# System profiler informations
Expand Down
6 changes: 6 additions & 0 deletions lib/FusionInventory/Agent/Task/Inventory/Input/Win32/User.pm
Expand Up @@ -15,6 +15,9 @@ use Win32::TieRegistry (
qw/KEY_READ/
);

Win32::OLE->Option(CP => Win32::OLE::CP_UTF8);


use FusionInventory::Agent::Tools::Win32;

my $seen;
Expand Down Expand Up @@ -52,6 +55,9 @@ sub doInventory {
DOMAIN => $domain->Get()
};

utf8::upgrade($user->{LOGIN});
utf8::upgrade($user->{DOMAIN});

next if $seen->{$user->{LOGIN}}++;

$inventory->addEntry(
Expand Down
17 changes: 15 additions & 2 deletions lib/FusionInventory/Agent/Tools/Win32.pm
Expand Up @@ -18,6 +18,7 @@ use Win32::TieRegistry (
qw/KEY_READ/
);

use utf8;
use File::Temp ();
use File::Temp qw(:seekable);
use Win32::Job;
Expand Down Expand Up @@ -66,7 +67,9 @@ sub encodeFromRegistry {
## no critic (ExplicitReturnUndef)
return undef unless $string;

return encode("UTF-8", decode(getLocalCodepage(), $string));
return $string if Encode::is_utf8($string);

return decode(getLocalCodepage(), $string);
}

sub getWmiObjects {
Expand All @@ -84,7 +87,17 @@ sub getWmiObjects {
)) {
my $object;
foreach my $property (@{$params{properties}}) {
$object->{$property} = $instance->{$property};
if (!ref($instance->{$property}) && $instance->{$property}) {
# cast the Win32::OLE object in string
$object->{$property} = sprintf("%s", $instance->{$property});

# because of the Win32::OLE->Option(CP => Win32::OLE::CP_UTF8);
# we know it's UTF8, let's flag the string according because
# Win32::OLE don't do it
utf8::upgrade($object->{$property});
} else {
$object->{$property} = $instance->{$property};
}
}
push @objects, $object;
}
Expand Down
1 change: 1 addition & 0 deletions lib/FusionInventory/Agent/XML/Query.pm
Expand Up @@ -24,6 +24,7 @@ sub getContent {
my ($self) = @_;

my $tpp = XML::TreePP->new(indent => 2);

return $tpp->write({ REQUEST => $self->{h} });
}

Expand Down
5 changes: 3 additions & 2 deletions t/inventory/macos/cpu.t
Expand Up @@ -25,7 +25,8 @@ my %tests = (
plan tests => scalar keys %tests;

foreach my $test (keys %tests) {
my $file = "resources/macos/sysctl/$test";
my @cpus = FusionInventory::Agent::Task::Inventory::Input::MacOS::Memory::_getCpus(file => $file);
my $sysctl = "resources/macos/sysctl/$test";
my $file = "resources/macos/system_profiler/$test";
my @cpus = FusionInventory::Agent::Task::Inventory::Input::MacOS::CPU::_getCpus(file => $file,sysctl => $sysctl);
is_deeply(\@cpus, $tests{$test}, $test);
}
112 changes: 56 additions & 56 deletions t/inventory/windows/softwares.t
Expand Up @@ -7081,75 +7081,75 @@ my %tests = (
},
wmi => {
xp => {
'981852' => {
'FROM' => 'WMI',
'NAME' => 'KB981852',
'COMMENTS' => 'Security Update for Windows XP (KB981852)',
'ARCH' => 'i586',
'RELEASE_TYPE' => 'Security Update'
'981852' => {
FROM => 'WMI',
NAME => 'KB981852',
COMMENTS => 'Security Update for Windows XP (KB981852)',
ARCH => 'i586',
RELEASE_TYPE => 'Security Update'
},
'981349' => {
'FROM' => 'WMI',
'NAME' => 'KB981349',
'COMMENTS' => 'Security Update for Windows XP (KB981349)',
'ARCH' => 'i586',
'RELEASE_TYPE' => 'Security Update'
FROM => 'WMI',
NAME => 'KB981349',
COMMENTS => 'Security Update for Windows XP (KB981349)',
ARCH => 'i586',
RELEASE_TYPE => 'Security Update'
},
'981322' => {
'FROM' => 'WMI',
'NAME' => 'KB981322',
'COMMENTS' => 'Security Update for Windows XP (KB981322)',
'ARCH' => 'i586',
'RELEASE_TYPE' => 'Security Update'
FROM => 'WMI',
NAME => 'KB981322',
COMMENTS => 'Security Update for Windows XP (KB981322)',
ARCH => 'i586',
RELEASE_TYPE => 'Security Update'
},
'980232' => {
'FROM' => 'WMI',
'NAME' => 'KB980232',
'COMMENTS' => 'Security Update for Windows XP (KB980232)',
'ARCH' => 'i586',
'RELEASE_TYPE' => 'Security Update'
FROM => 'WMI',
NAME => 'KB980232',
COMMENTS => 'Security Update for Windows XP (KB980232)',
ARCH => 'i586',
RELEASE_TYPE => 'Security Update'
},
'980436' => {
'FROM' => 'WMI',
'NAME' => 'KB980436',
'COMMENTS' => 'Security Update for Windows XP (KB980436)',
'ARCH' => 'i586',
'RELEASE_TYPE' => 'Security Update'
FROM => 'WMI',
NAME => 'KB980436',
COMMENTS => 'Security Update for Windows XP (KB980436)',
ARCH => 'i586',
RELEASE_TYPE => 'Security Update'
},
'982132' => {
'FROM' => 'WMI',
'NAME' => 'KB982132',
'COMMENTS' => 'Security Update for Windows XP (KB982132)',
'ARCH' => 'i586',
'RELEASE_TYPE' => 'Security Update'
FROM => 'WMI',
NAME => 'KB982132',
COMMENTS => 'Security Update for Windows XP (KB982132)',
ARCH => 'i586',
RELEASE_TYPE => 'Security Update'
},
'980195' => {
'FROM' => 'WMI',
'NAME' => 'KB980195',
'COMMENTS' => 'Security Update for Windows XP (KB980195)',
'ARCH' => 'i586',
'RELEASE_TYPE' => 'Security Update'
FROM => 'WMI',
NAME => 'KB980195',
COMMENTS => 'Security Update for Windows XP (KB980195)',
ARCH => 'i586',
RELEASE_TYPE => 'Security Update'
},
'981997' => {
'FROM' => 'WMI',
'NAME' => 'KB981997',
'COMMENTS' => 'Security Update for Windows XP (KB981997)',
'ARCH' => 'i586',
'RELEASE_TYPE' => 'Security Update'
FROM => 'WMI',
NAME => 'KB981997',
COMMENTS => 'Security Update for Windows XP (KB981997)',
ARCH => 'i586',
RELEASE_TYPE => 'Security Update'
},
'982214' => {
'FROM' => 'WMI',
'NAME' => 'KB982214',
'COMMENTS' => 'Security Update for Windows XP (KB982214)',
'ARCH' => 'i586',
'RELEASE_TYPE' => 'Security Update'
FROM => 'WMI',
NAME => 'KB982214',
COMMENTS => 'Security Update for Windows XP (KB982214)',
ARCH => 'i586',
RELEASE_TYPE => 'Security Update'
},
'982665' => {
'FROM' => 'WMI',
'NAME' => 'KB982665',
'COMMENTS' => 'Security Update for Windows XP (KB982665)',
'ARCH' => 'i586',
'RELEASE_TYPE' => 'Security Update'
FROM => 'WMI',
NAME => 'KB982665',
COMMENTS => 'Security Update for Windows XP (KB982665)',
ARCH => 'i586',
RELEASE_TYPE => 'Security Update'
}
}
}
Expand Down Expand Up @@ -7214,11 +7214,11 @@ is_deeply(
$kbList,
{
'981349' => {
'FROM' => 'WMI',
'NAME' => 'KB981349',
'COMMENTS' => 'Security Update for Windows XP (KB981349)',
'ARCH' => 'i586',
'RELEASE_TYPE' => 'Security Update'
FROM => 'WMI',
NAME => 'KB981349',
COMMENTS => 'Security Update for Windows XP (KB981349)',
ARCH => 'i586',
RELEASE_TYPE => 'Security Update'
}
},
"duplicated KB found in the KB stack are deleted"
Expand Down

0 comments on commit 711da05

Please sign in to comment.