Skip to content

Commit

Permalink
fixing bugs found by Jonas
Browse files Browse the repository at this point in the history
  • Loading branch information
jachym committed Aug 21, 2016
1 parent 497402a commit 2922312
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions pywps/app/Process.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def describe_xml(self):

def execute(self, wps_request, uuid):
self._set_uuid(uuid)
async = False
self.async = False
wps_response = WPSResponse(self, wps_request, self.uuid)

LOGGER.debug('Check if status storage and updating are supported by this process')
Expand All @@ -158,13 +158,13 @@ def execute(self, wps_request, uuid):
raise OperationNotSupported('Process does not support the updating of status')

wps_response.status = STATUS.STORE_AND_UPDATE_STATUS
async = True
self.async = True
else:
wps_response.status = STATUS.STORE_STATUS

LOGGER.debug('Check if updating of status is not required then no need to spawn a process')

wps_response = self._execute_process(async, wps_request, wps_response)
wps_response = self._execute_process(self.async, wps_request, wps_response)

return wps_response

Expand Down Expand Up @@ -210,7 +210,7 @@ def _execute_process(self, async, wps_request, wps_response):
if running < maxparalel:
wps_response = self._run_process(wps_request, wps_response)
else:
raise ServerBusy('Maximum number of paralel running processes reached. Please try later.')
raise ServerBusy('Maximum number of parallel running processes reached. Please try later.')

return wps_response

Expand Down Expand Up @@ -241,8 +241,8 @@ def _run_process(self, wps_request, wps_response):
self._set_grass()
wps_response = self.handler(wps_request, wps_response)

# if status not yet set to 100% then do it after execution was successful
if (not wps_response.status_percentage) or (wps_response.status_percentage != 100):
# only for asynchronous processing: if status not yet set to 100% then do it after execution was successful
if (self.async and (not wps_response.status_percentage or (wps_response.status_percentage != 100))):
LOGGER.debug('Updating process status to 100% if everything went correctly')
wps_response.update_status('PyWPS Process finished', 100, STATUS.DONE_STATUS)
except Exception as e:
Expand Down
3 changes: 2 additions & 1 deletion pywps/inout/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ def store(self, output):
file_name = output.file

file_block_size = os.stat(file_name).st_blksize
avail_size = get_free_space(self.target)
# get_free_space delivers the numer of free blocks, not the available size!
avail_size = get_free_space(self.target) * file_block_size
file_size = os.stat(file_name).st_size

# calculate space used according to block size
Expand Down

0 comments on commit 2922312

Please sign in to comment.