diff --git a/src/wpsremote/resource_monitor.py b/src/wpsremote/resource_monitor.py index fe1fe3b..f9c67f0 100644 --- a/src/wpsremote/resource_monitor.py +++ b/src/wpsremote/resource_monitor.py @@ -69,7 +69,7 @@ def proc_is_running(self, proc_defs): import traceback tb = traceback.format_exc() logger.debug(tb) - print(tb) + # print(tb) return False def update_stats(self): diff --git a/src/wpsremote/xmpp_data/configs/myservice/code/test.py b/src/wpsremote/xmpp_data/configs/myservice/code/test.py index e597c18..b057732 100644 --- a/src/wpsremote/xmpp_data/configs/myservice/code/test.py +++ b/src/wpsremote/xmpp_data/configs/myservice/code/test.py @@ -4,15 +4,16 @@ # This code is licensed under the GPL 2.0 license, available at the root # application directory. -import subprocess -import logging.config -import logging -import argparse -import sys import os +import sys +import time import uuid import zipfile -import time +import argparse +import subprocess + +import logging +import logging.config # constants # id = os.urandom(10) @@ -31,7 +32,11 @@ def __init__(self, args): self.logger.info("ProgressInfo:0.0%") def run(self): - trg = '%s/../../../output/%s/%s.shp' % (os.path.dirname(os.path.abspath(__file__)), self.args.execution_id, dst) + output_dir = '/tmp/%s' % self.args.execution_id + if not os.path.exists(output_dir): + os.makedirs(output_dir) + # trg = '%s/../../../output/%s/%s.shp' % (os.path.dirname(os.path.abspath(__file__)), self.args.execution_id, dst) + trg = '%s/%s.shp' % (output_dir, dst) # fullCmd = ' '.join([gdalContour, cmd, self.youCanQuoteMe(src), \ # self.youCanQuoteMe(dst), interval, self.args.interval]) @@ -56,7 +61,7 @@ def run(self): if (ret == 0): # zipf = zipfile.ZipFile(self.args.workdir+'/contour.zip', 'w') # self.zipdir(self.args.workdir+'/', zipf) - output_dir = '%s/../../../output/%s' % (os.path.dirname(os.path.abspath(__file__)), self.args.execution_id) + # output_dir = '%s/../../../output/%s' % (os.path.dirname(os.path.abspath(__file__)), self.args.execution_id) zipf = zipfile.ZipFile(output_dir+'/contour.zip', 'w') self.zipdir(output_dir+'/', zipf) zipf.close() diff --git a/src/wpsremote/xmpp_data/configs/myservice/service.config b/src/wpsremote/xmpp_data/configs/myservice/service.config index abf96cb..e7868ff 100644 --- a/src/wpsremote/xmpp_data/configs/myservice/service.config +++ b/src/wpsremote/xmpp_data/configs/myservice/service.config @@ -17,7 +17,8 @@ namespace = default description = GDAL Contour Remote Service executable_path = ./xmpp_data/configs/myservice/code executable_cmd = python %(executable_path)s/test.py -output_dir = ./xmpp_data/output/ +# output_dir = ./xmpp_data/output/ +output_dir = /tmp unique_execution_id = %(unique_exe_id)s workdir = %(output_dir)s/%(unique_execution_id)s active = True