Skip to content

errors not handled correctly in function [ spython/main/run.py. ] run() #62

@al3x609

Description

@al3x609

Expected Behavior

the function run should not get to execute this error AttributeError: 'NoneType' object has no attribute 'strip' in case of previous errors

like to:
ERROR Return Code -15: ( ... message ...)

Actual Behavior

this a intencional test:
I deploy a container that ends all processes within it after a defined time, with a call to kill

the first error ERROR Return Code -15 is correct because subprocess.Popen.returncode return -15 with the Unix signal SIGTERM=-15, sent by a call to kill;

but I should not get to evaluate the sentence result = result.strip('\n')

due to the error caught in the previous step

Steps to Reproduce

  • start any container indefinitely
  • kill the principal process inside de container in another terminal.
  • check the output in the first shell
    route access
    spyton.main.run.__init.__py._run_command -> Client._run_command -> command.run_command -> run_cmd(utils.terminal.run_command ) => subprocess.communicate()

Context

  • Operating System: centos 7 64 bits
  • singularity version: latest
  • spython version: latest
  • python version: 3.7

Failure Logs

image

Possible Fix

before

    result = result.strip('\n')

after

    if(result):
        result = result.strip('\n')

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions