summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPreston Cody <codeman@gentoo.org>2008-01-02 04:16:33 +0000
committerPreston Cody <codeman@gentoo.org>2008-01-02 04:16:33 +0000
commitffe274254918548d365926f58c80e93ba69d897e (patch)
tree99c2c94a20730edc3260e341399799f9b2bcd270
parentreturn job filename and print it (diff)
downloadscire-ffe274254918548d365926f58c80e93ba69d897e.tar.gz
scire-ffe274254918548d365926f58c80e93ba69d897e.tar.bz2
scire-ffe274254918548d365926f58c80e93ba69d897e.zip
fixin up get_jobs a bit.
svn path=/branches/new-fu/; revision=313
-rwxr-xr-xclient/scireclient.pl29
1 files changed, 18 insertions, 11 deletions
diff --git a/client/scireclient.pl b/client/scireclient.pl
index 640b3ec..15f323e 100755
--- a/client/scireclient.pl
+++ b/client/scireclient.pl
@@ -203,7 +203,7 @@ sub identify_client {
close(FILE);
my ($status, $message) = parse_response(send_command("IDENTIFY", $digest));
unless (defined $status && $status eq "OK") {
- print "Could not identify to server: $message\n";
+ print "ERROR Could not identify to server: $message\n";
return 0;
}
debug("Client identified");
@@ -213,20 +213,27 @@ sub identify_client {
sub get_jobs {
my ($status, $jobs) = parse_response(send_command("GET_JOBS"));
unless (defined $status && $status eq "OK") {
- print "Could not get jobs list from server: $jobs\n";
+ print "Could not get jobs list from server: $status\n";
return 0;
}
- $jobs =~ s/\s//g; #Remove all whitespace
- my @jobs_list = split(/,/, $jobs);
- foreach my $job (@jobs_list) {
- my ($status, $filename) = parse_response(send_command("GET_JOB", $job));
- #SCP the file to $conf{job_dir}/queue/
+ if (defined($jobs) && $jobs) {
+ $jobs =~ s/\s//g; #Remove all whitespace
+ my @jobs_list = split(/,/, $jobs);
+ foreach my $job (@jobs_list) {
+ my ($status, $filename) = parse_response(send_command("GET_JOB", $job));
+ #SCP the file to $conf{job_dir}/queue/
- system("cp $filename $conf{job_dir}/queue/") and die("Can't copy file: $!"); #Temporary hack. only works locally.
- # XXX: Modify this to fetch a file instead
- debug("Fetched job $job ");
+ system("cp $filename $conf{job_dir}/queue/") and die("Can't copy file: $!"); #Temporary hack. only works locally.
+ # XXX: Modify this to fetch a file instead
+ debug("Fetched job $job ");
+ my ($status2,$message) = parse_response(send_command("JOB_FETCHED", $job));
+ unless (defined $status2 && $status2 eq "OK") {
+ die("ERROR Could not signal job was fetched: $message\n");
+ }
+
+ }
+ #This function doesn't actually need to do anything with the list of jobs, the executor handles that part.
}
- #This function doesn't actually need to do anything with the list of jobs, the executor handles that part.
}
sub scan_jobs_dir {