Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return value of restart command #1226

Merged
1 commit merged into from
Apr 16, 2018
Merged

Return value of restart command #1226

1 commit merged into from
Apr 16, 2018

Conversation

e3rd
Copy link
Member

@e3rd e3rd commented Apr 13, 2018

Both start and stop command returned tuple (exit-status, string). Restart command returned ((exit-status-of-stop, string-of-stop), (exit-status-of-start, string-of-start)). Since exit-status was a tuple instead of a number, in the terminal error pipe received that tuple. Since intelmq-manager read only output-pipe, it wasn't aware of this incorrect behaviour. With my another pull request, intelmq-manager now handles error-pipe too, so that restart command stopped working.

Old wrong behaviour:

www-data@jezevec:~$ PATH=~/.local/bin intelmqctl restart abuse-ch-feodo-tracker-domains-parser
intelmqctl: abuse-ch-feodo-tracker-domains-parser was NOT RUNNING.
intelmqctl: Starting abuse-ch-feodo-tracker-domains-parser...
intelmqctl: abuse-ch-feodo-tracker-domains-parser is running.
(0, 'stopped')
www-data@jezevec:~$ PATH=~/.local/bin intelmqctl --type json restart abuse-ch-feodo-tracker-domains-parser
[0, "running"]
(0, 'stopped')

New correct behaviour:

www-data@jezevec:~$ PATH=~/.local/bin intelmqctl restart abuse-ch-feodo-tracker-domains-parser
intelmqctl: Stopping abuse-ch-feodo-tracker-domains-parser...
intelmqctl: abuse-ch-feodo-tracker-domains-parser is stopped.
intelmqctl: Starting abuse-ch-feodo-tracker-domains-parser...
intelmqctl: abuse-ch-feodo-tracker-domains-parser is running.
www-data@jezevec:~$ PATH=~/.local/bin intelmqctl --type json restart abuse-ch-feodo-tracker-domains-parser
["stopped", "running"]

Note that the return value reflects both operations, bot_start and bot_stop as seems intended by previous programmer.

@e3rd e3rd force-pushed the intelmqctl-restart-return branch from d76ed4e to f9ffeb7 Compare April 13, 2018 12:50
@ghost ghost self-assigned this Apr 13, 2018
@e3rd e3rd force-pushed the intelmqctl-restart-return branch from f9ffeb7 to 390f30e Compare April 14, 2018 11:33
@e3rd
Copy link
Member Author

e3rd commented Apr 15, 2018

What's all the Optional key 'naics' not found data errors please? I hope I have nothing in common with this errors and the PR is alright.

@ghost
Copy link

ghost commented Apr 15, 2018 via email

@e3rd
Copy link
Member Author

e3rd commented Apr 15, 2018

(I didn't intend to disturb you on week-end, of course that's a next weeks business :) )

@ghost ghost self-requested a review April 16, 2018 10:52
@ghost ghost added bug Indicates an unexpected problem or unintended behavior component: intelmqctl labels Apr 16, 2018
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add this to the CHANGELOG file? Thanks!

Both start and stop command returned tuple (exit-status, string). Restart command returned ((exit-status-of-stop, string-of-stop), (exit-status-of-start, string-of-start)). Since exit-status was a tuple instead of a number, in the terminal error pipe received that tuple. Since intelmq-manager read only output-pipe, it wasn't aware of this incorrect behaviour. With my another pull request, intelmq-manager now handles error-pipe too, so that restart command stopped working.

Old wrong behaviour:
www-data@jezevec:~$ PATH=~/.local/bin intelmqctl restart abuse-ch-feodo-tracker-domains-parser
intelmqctl: abuse-ch-feodo-tracker-domains-parser was NOT RUNNING.
intelmqctl: Starting abuse-ch-feodo-tracker-domains-parser...
intelmqctl: abuse-ch-feodo-tracker-domains-parser is running.
(0, 'stopped')
www-data@jezevec:~$ PATH=~/.local/bin intelmqctl --type json restart abuse-ch-feodo-tracker-domains-parser
[0, "running"]
(0, 'stopped')

New correct behaviour:

www-data@jezevec:~$ PATH=~/.local/bin intelmqctl restart abuse-ch-feodo-tracker-domains-parser
intelmqctl: Stopping abuse-ch-feodo-tracker-domains-parser...
intelmqctl: abuse-ch-feodo-tracker-domains-parser is stopped.
intelmqctl: Starting abuse-ch-feodo-tracker-domains-parser...
intelmqctl: abuse-ch-feodo-tracker-domains-parser is running.
www-data@jezevec:~$ PATH=~/.local/bin intelmqctl --type json restart abuse-ch-feodo-tracker-domains-parser
["stopped", "running"]
@e3rd e3rd force-pushed the intelmqctl-restart-return branch from 390f30e to a3106a1 Compare April 16, 2018 11:34
@e3rd
Copy link
Member Author

e3rd commented Apr 16, 2018

force-pushed with changelog

@ghost ghost merged commit a3106a1 into develop Apr 16, 2018
@ghost
Copy link

ghost commented Apr 16, 2018

Thanks!

@e3rd e3rd deleted the intelmqctl-restart-return branch April 16, 2018 12:11
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior component: intelmqctl
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant