GithubHelp home page GithubHelp logo

Comments (3)

cnelson avatar cnelson commented on September 18, 2024

So what's the ask here? You want to be able to specify a path to an arbitrary path and use the open fd to that path to enter a namespace? Something like:

with Namespace(path='/var/run/netns/foo'):
    # output network interfaces as seen from within the mypid's net NS:
    subprocess.check_output(['ip', 'a'])

Would that solve the problem?

from python-nsenter.

hjacobs avatar hjacobs commented on September 18, 2024

@cnelson I just found the StackOverflow question (http://stackoverflow.com/questions/30127569/start-multiprocessing-process-in-namespace) and I think that nobody should need to copy&paste the StackOverflow code for this specific use case --- it should be possible with the "nsenter" module.

So: yes, being able to pass in the path would be one possibility (obviously keeping everything backwards compatible).

I haven't thought much about it yet...

from python-nsenter.

cnelson avatar cnelson commented on September 18, 2024

Tossed up a quick PR as it was simpler than I thought it would be -- thoughts?

from python-nsenter.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.