summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: be76f0d)
raw | patch | inline | side by side (parent: be76f0d)
author | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 14 Apr 2008 15:00:04 +0000 (15:00 +0000) | ||
committer | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 14 Apr 2008 15:00:04 +0000 (15:00 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10434 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/server/events/gosaTriggered.pm | patch | blob | history |
index 6138e547db41385cd5f3f8510d203515030a22fb..0d4861e58f302acbf91855e3ef3be737810ffc47 100644 (file)
"trigger_action_wake",
"recreate_fai_server_db",
"send_user_msg",
+ "get_available_kernel",
);
@EXPORT = @events;
}
+sub get_available_kernel {
+ my ($msg, $msg_hash, $session_id) = @_;
+
+ my $source = @{$msg_hash->{'source'}}[0];
+ my $target = @{$msg_hash->{'target'}}[0];
+ my $server = @{$msg_hash->{'server'}}[0];
+
+ # Get available Releases for server
+ my $sql_statement = "SELECT * FROM $main::fai_server_tn WHERE server LIKE '%$server%'";
+ my $res_hash = $main::fai_server_db->select_dbentry($sql_statement);
+
+ my @kernel;
+ foreach my $release (keys %{$res_hash}) {
+ # Get Kernel packages for release
+ my $sql_statement = "SELECT * FROM $main::packages_list_tn WHERE distribution='".$res_hash->{$release}->{'release'}."' AND package LIKE 'linux\-image\-%'";
+ my $hash = $main::packages_list_db->select_dbentry($sql_statement);
+ foreach my $package (keys %{$hash}) {
+ push @kernel, (%{$res_hash}->{$release}->{'release'})."|".(%{$hash}->{$package}->{'package'});
+ }
+ }
+
+ my %data = ('available-kernel' => \@kernel);
+
+ my $out_msg = &build_msg("get_available_kernel", $target, "GOSA", \%data);
+ return ( $out_msg );
+}
+
1;