summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPreston Cody <codeman@gentoo.org>2008-01-02 02:01:51 +0000
committerPreston Cody <codeman@gentoo.org>2008-01-02 02:01:51 +0000
commit9be3d2375b5347d420e69acd8201762dd0a2608c (patch)
tree1a7004788a844e719b125831bc75733b604020f3
parentadd status_id param to get_jobs() (diff)
downloadscire-9be3d2375b5347d420e69acd8201762dd0a2608c.tar.gz
scire-9be3d2375b5347d420e69acd8201762dd0a2608c.tar.bz2
scire-9be3d2375b5347d420e69acd8201762dd0a2608c.zip
add debug to response line
added other paths to check_job_dir fixed up get_job a bit. svn path=/branches/new-fu/; revision=310
-rwxr-xr-xclient/scireclient.pl27
1 files changed, 20 insertions, 7 deletions
diff --git a/client/scireclient.pl b/client/scireclient.pl
index 1da3dcd..640b3ec 100755
--- a/client/scireclient.pl
+++ b/client/scireclient.pl
@@ -95,6 +95,7 @@ sub send_command {
#FIXME WE NEED A TIMEOUT HERE OF SOME SORT!!
#if the server doesn't give you a newline this just hangs!
my $response = <SERVER_STDOUT>;
+ debug("Got response: ${response}");
return $response;
}
@@ -141,6 +142,21 @@ sub check_job_dir {
mkpath( $conf{job_dir}, {verbose => 1, mode => 0660})
or die("Couldn't make $conf{job_dir} w/ perms 0660: $!");
}
+ if (! -d "$conf{job_dir}/queue") {
+ print "WARNING! $conf{job_dir}/queue does not exist...creating\n";
+ mkpath( "$conf{job_dir}/queue", {verbose => 1, mode => 0660})
+ or die("Couldn't make $conf{job_dir}/queue w/ perms 0660: $!");
+ }
+ if (! -d "$conf{job_dir}/done") {
+ print "WARNING! $conf{job_dir}/done does not exist...creating\n";
+ mkpath( "$conf{job_dir}/done", {verbose => 1, mode => 0660})
+ or die("Couldn't make $conf{job_dir}/done w/ perms 0660: $!");
+ }
+ if (! -d "$conf{job_dir}/failed") {
+ print "WARNING! $conf{job_dir}/failed does not exist...creating\n";
+ mkpath( "$conf{job_dir}/failed", {verbose => 1, mode => 0660})
+ or die("Couldn't make $conf{job_dir}/failed w/ perms 0660: $!");
+ }
}
sub read_config_file {
@@ -203,14 +219,11 @@ sub get_jobs {
$jobs =~ s/\s//g; #Remove all whitespace
my @jobs_list = split(/,/, $jobs);
foreach my $job (@jobs_list) {
- my ($status, $message) = parse_response(send_command("GET_JOB", $job));
- open(JOBFILE, ">$conf{job_dir}/queue/${job}.job") or do {
- print "Could not open $conf{job_dir}/queue/${job}.job for writing: $!";
- next;
- };
+ 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
-# print JOBFILE parse_response($resp);
- close(JOBFILE);
debug("Fetched job $job ");
}
#This function doesn't actually need to do anything with the list of jobs, the executor handles that part.