summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6c9134c)
raw | patch | inline | side by side (parent: 6c9134c)
author | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 29 May 2008 13:43:30 +0000 (13:43 +0000) | ||
committer | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 29 May 2008 13:43:30 +0000 (13:43 +0000) |
fix issue when no servers are available.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11108 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11108 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/gosa-si-client | patch | blob | history |
diff --git a/gosa-si/gosa-si-client b/gosa-si/gosa-si-client
index 05632d3167ead89f416e6eca35a599e2dc314f0f..f01b310e5d5b4b6bc5755b468efe9c3c2d4276f3 100755 (executable)
--- a/gosa-si/gosa-si-client
+++ b/gosa-si/gosa-si-client
# a registration never occured
push( @servers, $server );
+ if(!(defined($server) && $server =~ m/^[0-9\.]*?:.*$/)) {
+ &main::daemon_log("ERROR: Server with address '".defined($server)?$server:""."' is invalid!", 1);
+ if (length(@servers) == 1) {
+ &main::daemon_log("ERROR: No valid servers found!", 1);
+ exit(1);
+ }
+ }
+
# Check if our ip is resolvable - if not: don't try to register
my $ip= &get_local_ip_for_remote_ip(sprintf("%s", $server =~ /^([0-9\.]*?):.*$/));
my $dnsname= gethostbyaddr(inet_aton($ip), AF_INET);
}
-sub import_events {
-
- if (not -e $event_dir) {
- daemon_log("ERROR: cannot find directory or directory is not readable: $event_dir", 1);
- }
- opendir (DIR, $event_dir) or die "ERROR while loading gosa-si-events from directory $event_dir : $!\n";
-
- while (defined (my $event = readdir (DIR))) {
- if( $event eq "." || $event eq ".." ) { next; }
- daemon_log("INFO: found event module: $event", 5);
- eval{ require $event; };
- if( $@ ) {
- daemon_log("ERROR: import of event module '$event' failed", 1);
- daemon_log("$@", 1);
- next;
- }
-
- $event =~ /(\S*?).pm$/;
- my $event_module = $1;
- my $events_l = eval( $1."::get_events()") ;
- foreach my $event_name (@{$events_l}) {
- $event_hash->{$event_name} = $event_module;
- }
-
- }
-
- my @all_events = keys %$event_hash;
- my $all_events_string = join(", ", @all_events);
-
- daemon_log("INFO: imported events: $all_events_string", 5);
-}
+#sub import_events {
+#
+# if (not -e $event_dir) {
+# daemon_log("ERROR: cannot find directory or directory is not readable: $event_dir", 1);
+# }
+# opendir (DIR, $event_dir) or die "ERROR while loading gosa-si-events from directory $event_dir : $!\n";
+#
+# while (defined (my $event = readdir (DIR))) {
+# if( $event eq "." || $event eq ".." ) { next; }
+# daemon_log("INFO: found event module: $event", 5);
+# eval{ require $event; };
+# if( $@ ) {
+# daemon_log("ERROR: import of event module '$event' failed", 1);
+# daemon_log("$@", 1);
+# next;
+# }
+#
+# $event =~ /(\S*?).pm$/;
+# my $event_module = $1;
+# my $events_l = eval( $1."::get_events()") ;
+# foreach my $event_name (@{$events_l}) {
+# $event_hash->{$event_name} = $event_module;
+# }
+#
+# }
+#
+# my @all_events = keys %$event_hash;
+# my $all_events_string = join(", ", @all_events);
+#
+# daemon_log("INFO: imported events: $all_events_string", 5);
+#}
sub trigger_new_key {
my ($kernel) = $_[KERNEL] ;
# import events
-&import_events();
+&import_events($event_dir);
# compute hardware checksum