[Tutor] Remote module loading

Mats Wichmann mats at wichmann.us
Thu Sep 7 20:25:25 EDT 2017


On 09/07/2017 12:49 AM, devN wrote:
> Hi,
> I am newbie in python. I wrote a module which is meant to be run across
> couple of unix OS variants (redhat, debian, bsd and solaris). The module is
> updated frequently and new features added.
> 
...
> The above code was an alpha and there could be further optimizations which
> I request you to overlook.
> My requirement is, I have an agent copied in all the UNIX variants and I
> have done that only once and dont want to do it again (too many machines
> and no possibility of ansible or chef implementation). The agent currently
> loads the module locally but I need to let all clients know that the module
> is updated with new features, but really can't.
> So I thought to expose the module as plain text over http from a remote
> apache container. Is there any way to load the module from remote just as
> simple as import statement (without using urllib or wget piped to python)?
> This could also mean does PYTHONPATH support http/ftp?
> 
> Thanks

We had a bit of a discussion not too long ago about the general topic.
You can search in the list archive for "How to deploy seamless script
updates to your clients"

You've left a situation that isn't really very flexible since you say
you don't want to copy the agent again.  Nonetheless, I'll point you to
a little bit of fiddling I did on this topic that you could just chew on
and see if it makes any sense.  It's not really "newbie" code.  The
basic idea is that you have a known location which contains a file with
information about available releases; the module has a function a
participating script can call to find out if it has a new version
available.

Link to my pointer to this:
https://www.mail-archive.com/tutor@python.org/msg76681.html


The rest of the discussion has some other good ideas in it too (a
version control server may be able to provide a kind of solution).



More information about the Tutor mailing list