You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I install askmanta without first configuring environmental variables, it gives me this error:
Running setup.py (path:/var/folders/4m/zzbwyss11r77z85h92r63lcr0000gn/T/pip-VuyTdS-build/setup.py) egg_info for package from git+https://github.com/stdbrouw/askmanta
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/var/folders/4m/zzbwyss11r77z85h92r63lcr0000gn/T/pip-VuyTdS-build/setup.py", line 3, in <module>
from askmanta import VERSION
File "askmanta/__init__.py", line 5, in <module>
import job, manifest
File "askmanta/job.py", line 5, in <module>
from askmanta.environment import client
File "askmanta/environment.py", line 9, in <module>
if 'localhost' in os.environ['MANTA_URL']:
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserDict.py", line 23, in __getitem__
raise KeyError(key)
KeyError: 'MANTA_URL'
This should be somehow covered on initialization of jobs etc or more explicitly stated.
i wrote a connect module but wasn't sure how to integrate it, hence no PR ;).
importosimportloggingimportmantalogging.basicConfig()
MANTA_URL=os.getenv('MANTA_URL')
MANTA_USER=os.getenv('MANTA_URL')
MANTA_KEY_ID=os.getenv('MANTA_KEY_ID')
classMantaConnectionError(Exception):
passdef_check_env():
""" Make sure environmental variables are present. """ifnotMANTA_URL:
raiseMantaConnectionError(
'You must set MANTA_URL as an environmental variable.'
)
ifnotMANTA_USER:
raiseMantaConnectionError(
'You must set MANTA_USER as an environmental variable.'
)
if'localhost'notinMANTA_URL:
ifnotMANTA_KEY_ID:
raiseMantaConnectionError(
'For a non-local client, you must set''MANTA_KEY_ID as an environmental variable.'
)
defconnect():
""" connect to manta """_check_env()
if'localhost'inMANTA_URL:
client=manta.MantaClient(MANTA_URL, MANTA_USER, internal=True)
else:
signer=manta.SSHAgentSigner(MANTA_KEY_ID)
client=manta.MantaClient(MANTA_URL, MANTA_USER, MANTA_KEY_ID)
returnclient# HACK for now, should figure out how # to announce errors on init of various classes.client=connect()
The text was updated successfully, but these errors were encountered:
If I install
askmanta
without first configuring environmental variables, it gives me this error:This should be somehow covered on initialization of jobs etc or more explicitly stated.
i wrote a connect module but wasn't sure how to integrate it, hence no PR ;).
The text was updated successfully, but these errors were encountered: