Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
Gonéri Le Bouder committed Jan 9, 2013
1 parent ddeb074 commit 1c1ff30
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions lib/FusionInventory/Agent/Task/Collect.pm
Expand Up @@ -179,6 +179,7 @@ sub _getFromWMI {
my @objs = FusionInventory::Agent::Tools::Win32::getWmiObjects(%params);

foreach my $obj (@objs) {
print Dumper($obj);
push @return, $obj;
}

Expand Down Expand Up @@ -242,29 +243,28 @@ sub run {
);
print "JOBS:" . Dumper($jobs);

$jobs = [
{
"function" => "getFromWMI",
"class" => "Win32_Keyboard",
"properties" => [ "Name", "Caption", "Manufacturer", "Description", "Layout" ],
"uuid" => "xxxx3"
},

# $jobs = [
#{
# "function" => "getFromWMI",
# "class" => "Win32_Keyboard",
# "properties" => [ "Name", "Caption", "Manufacturer", "Description", "Layout" ],
# "uuid" => "xxxx3"
#},
# {
# "function" => "runCommand",
# "dir" => "/", # Where to run the command
# "command" => "ipconfig",
# "uuid" => "xxxx3",
# "filter" => { "firstMatch" => '(Windows.*)' }
# },
{
"recursive" => 0,
"function" => "getFromRegistry",
"64bit" => 0,
"path" =>
"HKEY_LOCAL_MACHINE/SOFTWARE/FusionInventory-Agent/*",
"uuid" => "xxxx1"
},
# {
# "recursive" => 0,
# "function" => "getFromRegistry",
# "64bit" => 0,
# "path" =>
#"HKEY_LOCAL_MACHINE/SOFTWARE/FusionInventory-Agent/*",
# "uuid" => "xxxx1"
# },
# {
# "function" => "findFile",
# "dir" => "/windows", # Default is, every where
Expand All @@ -286,7 +286,7 @@ sub run {
#
# }

];
# ];

return unless $jobs;
return unless ref($jobs) eq 'ARRAY';
Expand All @@ -308,10 +308,12 @@ sub run {

my @result = &{ $functions{ $job->{function} } }(%$job);

print Dumper(\@result);

next unless @result;

foreach my $r (@result) {
die unless ref($r) eq 'HASH';
next unless ref($r) eq 'HASH';
next unless keys %$r;
$r->{uuid} = $job->{uuid};
$r->{action} = "setAnswer";
Expand Down

0 comments on commit 1c1ff30

Please sign in to comment.