summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPreston Cody <codeman@gentoo.org>2007-12-31 17:58:41 +0000
committerPreston Cody <codeman@gentoo.org>2007-12-31 17:58:41 +0000
commit7f888e372b5a2ec9c5e8a4d45397985b4f9049a4 (patch)
treed516b8a80e10fb30216b42de0161084bda41acf4
parentdrop tab in heredoc terminator (diff)
downloadscire-7f888e372b5a2ec9c5e8a4d45397985b4f9049a4.tar.gz
scire-7f888e372b5a2ec9c5e8a4d45397985b4f9049a4.tar.bz2
scire-7f888e372b5a2ec9c5e8a4d45397985b4f9049a4.zip
cleaned up the debugging. took out existing jobs lines.
svn path=/branches/new-fu/; revision=292
-rwxr-xr-xclient/scireclient.pl16
1 files changed, 7 insertions, 9 deletions
diff --git a/client/scireclient.pl b/client/scireclient.pl
index 6485bac..bfab4a5 100755
--- a/client/scireclient.pl
+++ b/client/scireclient.pl
@@ -46,7 +46,7 @@ sub run_main {
#3. Scan the jobs directory. If there are done/failed jobs, report them. Note jobs in running or queue.
my @existing_jobs = scan_jobs_dir();
#4. Fetch the jobs list
- get_jobs(@existing_jobs);
+ get_jobs();
#5. ???
#6. Profit!
}
@@ -89,7 +89,7 @@ sub send_command {
$tosend .= " \"${arg}\"";
}
}
- debug("Sending: ${tosend}\n");
+ debug("Sending: ${tosend}");
print SERVER_STDIN "${tosend}\n";
#FIXME WE NEED A TIMEOUT HERE OF SOME SORT!!
#if the server doesn't give you a newline this just hangs!
@@ -166,7 +166,7 @@ sub register_client {
my ($mac, $ip) = get_interface_info(defined $conf{interface} && $conf{interface} ? $conf{interface} : "eth0");
my ($status, $message) = parse_response(send_command("REGISTER", $mac, $ip));
die "Could not register client $mac w/ ip $ip. Got: $message" if (! defined $status or $status ne "OK");
- debug("Client registered. Status is pending.\n");
+ debug("Client registered. Status is pending.");
}
sub identify_client {
@@ -183,18 +183,16 @@ sub identify_client {
print "Could not identify to server: $message\n";
return 0;
}
- debug("Client identified\n");
+ debug("Client identified");
return 1;
}
sub get_jobs {
- my @existing_jobs = @_;
- my ($status, $message) = parse_response(send_command("GET_JOBS", @existing_jobs));
+ my ($status, $jobs) = parse_response(send_command("GET_JOBS"));
unless (defined $status && $status eq "OK") {
print "Could not get jobs list from server: $message\n";
return 0;
}
- my $jobs = $2;
$jobs =~ s/\s//g; #Remove all whitespace
my @jobs_list = split(/,/, $jobs);
foreach my $job (@jobs_list) {
@@ -206,7 +204,7 @@ sub get_jobs {
# XXX: Modify this to fetch a file instead
# print JOBFILE parse_response($resp);
close(JOBFILE);
- debug("Fetched job $job \n");
+ debug("Fetched job $job ");
}
#This function doesn't actually need to do anything with the list of jobs, the executor handles that part.
}
@@ -240,7 +238,7 @@ sub scan_jobs_dir {
sub debug {
my $msg = shift;
if($conf{debug}) {
- print STDERR $msg;
+ print STDERR $msg."\n";
}
}