zalando / python-nsenter Goto Github PK
View Code? Open in Web Editor NEWEnter kernel namespaces from Python
Home Page: https://pypi.python.org/pypi/nsenter
License: Other
Enter kernel namespaces from Python
Home Page: https://pypi.python.org/pypi/nsenter
License: Other
$ docker run -it python:3.10 pip install nsenter
Collecting nsenter
Downloading nsenter-0.2-py3-none-any.whl (12 kB)
Collecting contextlib2
Downloading contextlib2-21.6.0-py2.py3-none-any.whl (13 kB)
Collecting argparse
Downloading argparse-1.4.0-py2.py3-none-any.whl (23 kB)
Collecting pathlib
Downloading pathlib-1.0.1.tar.gz (49 kB)
|████████████████████████████████| 49 kB 2.6 MB/s
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-quttjgpr/pathlib_d60a79e90d4a49f48ae63d6cdcbc2493/setup.py'"'"'; __file__='"'"'/tmp/pip-install-quttjgpr/pathlib_d60a79e90d4a49f48ae63d6cdcbc2493/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-zlfypxgz
cwd: /tmp/pip-install-quttjgpr/pathlib_d60a79e90d4a49f48ae63d6cdcbc2493/
Complete output (13 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python3.10/site-packages/setuptools/__init__.py", line 16, in <module>
import setuptools.version
File "/usr/local/lib/python3.10/site-packages/setuptools/version.py", line 1, in <module>
import pkg_resources
File "/usr/local/lib/python3.10/site-packages/pkg_resources/__init__.py", line 23, in <module>
import zipfile
File "/usr/local/lib/python3.10/zipfile.py", line 19, in <module>
import pathlib
File "/tmp/pip-install-quttjgpr/pathlib_d60a79e90d4a49f48ae63d6cdcbc2493/pathlib.py", line 10, in <module>
from collections import Sequence
ImportError: cannot import name 'Sequence' from 'collections' (/usr/local/lib/python3.10/collections/__init__.py)
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/ac/aa/9b065a76b9af472437a0059f77e8f962fe350438b927cb80184c32f075eb/pathlib-1.0.1.tar.gz#sha256=6940718dfc3eff4258203ad5021090933e5c04707d5ca8cc9e73c94a7894ea9f (from https://pypi.org/simple/pathlib/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
This is caused by the dependency on pathlib, this was fixed by commit b7fd78f but a new pypi version was not published.
Hi, I tried to use this lib which is published at pypi, but the latest version at pypi is 0.2.
I want this commit to load this lib on Mac.
I workaround by using it from github directly, but I want to freeze the version.
Can someone publish it, please?
It looks like the link is wrong or blog was deleted?
Add more documentation to the project please.
E.g. how could I implement the following command into python using the nsenter module?:
nsenter -t 1 --wd=/usr/local/bin -m -- docker ps
Do you have plans to build this out any further?
argparse is not really needed except in older version of Python. How do you feel about moving them into setup.py
and gating them for < 2.7 and < 3.3 ?
Context: @ Facebook we build modules into our own wheels and auto generate dependencies. Your modules, even with Python 3.6 today insists on these modules so our automation co-operates.
Many thanks for the module!
nsenter/main.py imports the installed module rather than its code which enforces a reinstallation of the module after each code change
This is a very valid use case and should be supported by the nsenter library: http://stackoverflow.com/questions/30127569/start-multiprocessing-process-in-namespace
According to your API, I can only enter a namespace once at a time, for example, pid or net.
What if I want to enter pid and net in the same time?
I successfully used this lib for entering my net namespace (for example - myns0), but there is no DNS at all inside it.
Of course I have a valid resolv.conf in /etc/netns/myns0/ and it works well when I call commands in shell like "ip netns exec myns0 ping google.com".
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.