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

[refactor] Use utility function for calling popen() properly #61

Open
nemesifier opened this issue Aug 13, 2021 · 2 comments
Open

[refactor] Use utility function for calling popen() properly #61

nemesifier opened this issue Aug 13, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@nemesifier
Copy link
Member

It would be good to create a utility function which does the read, close and returning of the output when using io.popen().

This would also ensure that whoever will put their hands on this code will keep reusing our function and avoid messing it up again by forgetting to close a pipe.

@nemesifier nemesifier added the enhancement New feature or request label Aug 13, 2021
@nemesifier nemesifier added this to To do (general) in OpenWISP Contributor's Board via automation Aug 13, 2021
@devkapilbansal
Copy link
Member

The current problem I am facing with this is that if we create a function in monitoring_utils.lua and load it, then the io defined in first table, TestNeighbor or TestInterface is getting used by the next one, i.e. TestNetJSON

Opened a thread here:- https://www.luaforum.com/threads/not-able-to-mock-io-library.505/

@atb00ker atb00ker moved this from To do (general) to To do (ansible/docker) in OpenWISP Contributor's Board Jan 31, 2022
@atb00ker atb00ker moved this from To do (ansible/docker) to To do (Python & Django) in OpenWISP Contributor's Board Jan 31, 2022
@Saurabh-Mokashi
Copy link

Hi, would like to contribute to this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
OpenWISP Contributor's Board
  
To do (Python & Django)
Development

No branches or pull requests

3 participants