Skip to content

Commit

Permalink
keep module public interface first
Browse files Browse the repository at this point in the history
  • Loading branch information
guillomovitch committed Nov 7, 2012
1 parent ce4767d commit 9392708
Showing 1 changed file with 21 additions and 22 deletions.
43 changes: 21 additions & 22 deletions lib/FusionInventory/Agent/Task/Inventory/Input/Win32/License.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,33 @@ use Win32::TieRegistry (
qw/KEY_READ/
);


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

sub isEnabled {
return 1;
}

sub doInventory {
my (%params) = @_;

# TODO: 64/32 bit support
my $machKey = $Registry->Open('LMachine', {
Access => KEY_READ ## no critic (ProhibitBitwise)
}) or $params{logger}->error("Can't open HKEY_LOCAL_MACHINE key: $EXTENDED_OS_ERROR");

my $office =
$machKey->{"SOFTWARE/Microsoft/Office"};

my @found;

_scanOffice($office, \@found);

foreach my $license (@found) {
$params{inventory}->addEntry(section => 'LICENSEINFOS', entry => $license);
}

}

sub _scanOffice {
my ($currentKey, $found) = @_;

Expand Down Expand Up @@ -68,25 +88,4 @@ sub _scanOffice {
}


sub doInventory {
my (%params) = @_;

# TODO: 64/32 bit support
my $machKey = $Registry->Open('LMachine', {
Access => KEY_READ ## no critic (ProhibitBitwise)
}) or $params{logger}->error("Can't open HKEY_LOCAL_MACHINE key: $EXTENDED_OS_ERROR");

my $office =
$machKey->{"SOFTWARE/Microsoft/Office"};

my @found;

_scanOffice($office, \@found);

foreach my $license (@found) {
$params{inventory}->addEntry(section => 'LICENSEINFOS', entry => $license);
}

}

1;

0 comments on commit 9392708

Please sign in to comment.