If you are using some modules in a function passed to Server.submit [docs], you need to specify these in the modules argument. See below:
import os
def get_os_name():
return os.name
jobserver.submit(get_os_name,modules=('os',))
But, I would like to do something like this:
from os import name
def get_os_name():
return name
# Obviously won't work
jobserver.submit(get_os_name,modules=('os',))
How do I get the second code chunk to work? I tried replace 'os' with 'os.name' and stuff like that, but no luck.