try, except
This commit is contained in:
parent
fd78283db4
commit
dd9eb6e08b
|
@ -137,8 +137,11 @@ if __name__ == "__main__":
|
|||
except KeyError:
|
||||
from os.path import expanduser
|
||||
home = expanduser("~")
|
||||
o = open(home + '/.vault-token','r')
|
||||
vault['VAULT_TOKEN'] = o.read().splitlines()[0]
|
||||
try:
|
||||
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:
|
||||
try:
|
||||
|
|
Loading…
Reference in a new issue