Comments (5)
I don't think that's very robust because you can't guess everything
instead, what about a dry run mode ? where we run everything for a few seconds and stop everything, just to make sure everything is sane.
from circus.
this is the case actually, the OSError is catched and stop after the retry limit (by default 5) .
I was thinking to use something like:
def check_cmd(cmd, env=None):
os_env = os.environ
if isinstance(env, dict):
os_env.update(env)
cmd_path = cmd.split(None)[0]
if os.path.isabs(cmd_path) and os.path.exists(cmd_path):
return True
if os.path.dirname(path):
path = os.path.normpath(os.path.realpath(cmd_path))
if os.path.exists(path):
return True
env_path = os_env.get('PATH')
if not env_path:
# we can't do anything here.
return True
for path in paths.split(os.pathsep):
filename = os.path.join(path, cmd_path)
if os.access(filename, os.X_OK):
return True
return False
which does that. The idea is to return an error first instead of creating a show. Not sure if it's really important there since we can update dynamically the command or remove a show though.
from circus.
mmm... knowing that the file exist don't make it a valid program -- I am not sure this is very useful since the real validation is actually running the program with the configured options.
from circus.
the idea is to test common mistakes like forgetting a / at startup or giving wrong path). We could also test the executable bit eventually. With that we could remove extra time check due to retries.
from circus.
it's already handled somehow by Popen. Let's close it for now.
from circus.
Related Issues (20)
- circusctl unable to set selected options
- Alternative ways to discuss circus library HOT 1
- Fallback for os env vars HOT 1
- Plugin HttpObserver broken since 0.17 because of change in AsyncHTTPClient from Tornado 5
- Trouble accessing web dashboard
- util.py: load_virtualenv broken with Python 3.10
- Hang caused by circus and psutil using conflicting methods to identify a process
- a pypy venv issue
- arbiter is already running arbiter_start_watchers command HOT 2
- Add Python3.9 and PyPy to support list HOT 3
- Copying environment variables with dollar sign + capital letters
- Make a new release supporting Python 3.10 HOT 3
- Move away from `nose` as the testing framework
- Add official support for Python 3.10 HOT 1
- Adopt PEP 621
- Consider removing `papa` dependency HOT 1
- Move `tests` outside of the main package HOT 2
- ConflictError arbiter is already running arbiter_start_watchers command HOT 1
- Util.py/load_virtualenv picks incorrect python version if py_ver=None
- DeprecationWarning: 'pipes' is deprecated and slated for removal in Python 3.13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from circus.