Replies: 3 comments
-
Call me paranoid, but I don't want to be faced with a hard-to-squash bug that is caused by a shared variable being set to an unexpected value (had too much of that in the past). Running an external command guarantees a clean slate (and memory is cheap these days anyway ;). However, I was thinking along the same lines a few days ago: the main netlab command could save the path to the script, and the recursive calls to netlab could use that path (or an environment variable). |
Beta Was this translation helpful? Give feedback.
-
I was thinking it would solve things like the debug verbosity level being
passed consistently between stages
In Python you have 'globals()' which lists all global variables, if you're
worried about unexpected values you could store list(globals()) at the
beginning, and print out the delta between stages. Should be a small set
anyway
…On Sun, Dec 19, 2021 at 9:40 AM Ivan Pepelnjak ***@***.***> wrote:
Call me paranoid, but I don't want to be faced with a hard-to-squash bug
that is caused by a shared variable being set to an unexpected value (had
too much of that in the past). Running an external command guarantees a
clean slate (and memory is cheap these days anyway ;).
However, I was thinking along the same lines a few days ago: the main
*netlab* command could save the path to the script, and the recursive
calls to *netlab* could use that path (or an environment variable).
—
Reply to this email directly, view it on GitHub
<#79 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAPQAC2UZEA4KL4SLQMPPR3URX4HVANCNFSM5KL7V5XA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Fixed this by adding the path to the current version of netlab into the PATH environment variable. |
Beta Was this translation helpful? Give feedback.
-
e.g. https://github.com/ipspace/netsim-tools/blob/fe5de47e80bb8a50597f46ca69986b9c17b249a9/netsim/cli/external_commands.py#L79
Instead of invoking 'netlab' as an "external" command, the code could simply call initial.run(...) without starting a new process (avoiding any path/versioning issues, no guarantees that 'netlab' resolves to the same program)
Beta Was this translation helpful? Give feedback.
All reactions