Skip to content

Conversation

@jtpereyda
Copy link
Contributor

Fixed bug introduced by refactor. Sulley would indicate that a target failed to restart, even when it didn't.

Session.restart_target is used (by poll_pedrpc) as if it returns True or False. It actually returned None or False.

In master, sulley/sessions.py line 705 revision 54bdbbe

            if self.restart_target(target, stop_first=False) == False:
                self.logger.critical("Restarting the target failed, exiting.")
                ...

In sulley_refactor, sulley/sessions.py line 673 revision 256c21d

            if not self.restart_target(target, stop_first=False):
                self.logger.critical("Restarting the target failed, exiting.")
                ...

The problem is that restart_target never returned True if it succeeded. It returned None. This worked before, since None == False is False. But not None is True. I updated restart_target to return True if it succeeds.

>>> None == False
False
>>> not None
True

…poll_pedrpc) as if it returns True or False. It actually returned None or False, counterintuitively.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant