try, except
This commit is contained in:
parent
fd78283db4
commit
dd9eb6e08b
|
@ -137,8 +137,11 @@ if __name__ == "__main__":
|
||||||
except KeyError:
|
except KeyError:
|
||||||
from os.path import expanduser
|
from os.path import expanduser
|
||||||
home = expanduser("~")
|
home = expanduser("~")
|
||||||
o = open(home + '/.vault-token','r')
|
try:
|
||||||
vault['VAULT_TOKEN'] = o.read().splitlines()[0]
|
o = open(home + '/.vault-token','r')
|
||||||
|
vault['VAULT_TOKEN'] = o.read().splitlines()[0]
|
||||||
|
except FileNotFoundError as e:
|
||||||
|
print('Error %s variable is missing' % str(e))
|
||||||
|
|
||||||
if len(sys.argv) > 1:
|
if len(sys.argv) > 1:
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue