index 6138e547db41385cd5f3f8510d203515030a22fb..aa9fada4f2890729333d1ba9d5a51da4dc1ee392 100644 (file)
"trigger_action_rescan",
"trigger_action_wake",
"recreate_fai_server_db",
+ "recreate_fai_release_db",
"send_user_msg",
+ "get_available_kernel",
);
@EXPORT = @events;
}
$main::fai_server_db->create_table("new_fai_server", \@main::fai_server_col_names);
- &main::create_fai_server_db("new_fai_server");
+ &main::create_fai_server_db("new_fai_server",undef,"dont", $session_id);
$main::fai_server_db->move_table("new_fai_server", $main::fai_server_tn);
my @out_msg_l = ( $out_msg );
}
+sub recreate_fai_release_db {
+ my ($msg, $msg_hash, $session_id) = @_ ;
+ my $out_msg;
+
+ my $jobdb_id = @{$msg_hash->{'jobdb_id'}}[0];
+ if( defined $jobdb_id) {
+ my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id='$jobdb_id'";
+ &main::daemon_log("$session_id DEBUG: $sql_statement", 7);
+ my $res = $main::job_db->exec_statement($sql_statement);
+ }
+
+ $main::fai_server_db->create_table("new_fai_release", \@main::fai_release_col_names);
+ &main::create_fai_release_db("new_fai_release", $session_id);
+ $main::fai_server_db->move_table("new_fai_release", $main::fai_release_tn);
+
+ my @out_msg_l = ( $out_msg );
+ return @out_msg_l;
+}
+
+
sub get_login_usr_for_client {
my ($msg, $msg_hash, $session_id) = @_ ;
my $header = @{$msg_hash->{'header'}}[0];
my $target = @{$msg_hash->{target}}[0];
my @out_msg_l;
- # create set_activated_for_installation message
+ # update status of job
my $jobdb_id = @{$msg_hash->{'jobdb_id'}}[0];
if( defined $jobdb_id) {
my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id='$jobdb_id'";
my $res = $main::job_db->exec_statement($sql_statement);
}
+ # create set_activated_for_installation message for delivery
my $out_hash = &create_xml_hash("set_activated_for_installation", $source, $target);
if( defined $jobdb_id ) {
&add_content2xml_hash($out_hash, 'jobdb_id', $jobdb_id);
my $out_msg = &create_xml_string($out_hash);
push(@out_msg_l, $out_msg);
- # create new_ldap_config message, client is waiting for that piece of information
- my $new_ldap_config_out = &main::new_ldap_config($source, $session_id);
- push(@out_msg_l, $new_ldap_config_out);
-
-
return @out_msg_l;
}
}
+sub get_available_kernel {
+ my ($msg, $msg_hash, $session_id) = @_;
+
+ my $source = @{$msg_hash->{'source'}}[0];
+ my $target = @{$msg_hash->{'target'}}[0];
+ my $release= @{$msg_hash->{'release'}}[0];
+
+ my @kernel;
+ # Get Kernel packages for release
+ my $sql_statement = "SELECT * FROM $main::packages_list_tn WHERE distribution='$release' AND package LIKE 'linux\-image\-%'";
+ my $res_hash = $main::packages_list_db->select_dbentry($sql_statement);
+ my %data;
+ my $i=1;
+
+ foreach my $package (keys %{$res_hash}) {
+ $data{"answer".$i++}= ${$res_hash}{$package}->{'package'};
+ }
+
+ my $out_msg = &build_msg("get_available_kernel", $target, "GOSA", \%data);
+ return ( $out_msg );
+}
+
+
1;