Skip to content

Commit

Permalink
get the final devices list before using udev
Browse files Browse the repository at this point in the history
  • Loading branch information
guillomovitch committed Jul 19, 2012
1 parent d4b0934 commit c1c843a
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions lib/FusionInventory/Agent/Task/Inventory/Input/Linux/Storages.pm
Expand Up @@ -18,12 +18,10 @@ sub doInventory {
my $inventory = $params{inventory};
my $logger = $params{logger};

my @devices;

# get informations from hal first, if available
if (canRun('lshal')) {
@devices = getDevicesFromHal(logger => $logger);
}
# get devices list from hal, if available, from sysfs otherwise
my @devices = canRun('lshal') ?
getDevicesFromHal(logger => $logger) :
getDevicesFromProc(logger => $logger);

# index devices by name for comparaison
my %devices = map { $_->{NAME} => $_ } @devices;
Expand All @@ -37,12 +35,6 @@ sub doInventory {
}
}

# fallback on sysfs if /dev/.udev is not available. That's the
# case on any up to date Linux system
if (!@devices) {
@devices = getDevicesFromProc(logger => $logger);
}

# get serial & firmware numbers from hdparm, if available
if (_correctHdparmAvailable()) {
foreach my $device (@devices) {
Expand Down

0 comments on commit c1c843a

Please sign in to comment.