secrets: sys.argv peut ne pas exister
Du coup on fait gaffe.
This commit is contained in:
parent
2da409cf8c
commit
c95de3f7c0
1 changed files with 1 additions and 1 deletions
|
@ -31,7 +31,7 @@ import getpass
|
|||
def get(secret):
|
||||
""" Recupere un secret. """
|
||||
openlog('secrets_new')
|
||||
prog = os.path.basename(sys.argv[0])
|
||||
prog = os.path.basename(getattr(sys, 'argv', ['undefined'])[0])
|
||||
syslog('%s (in %s) asked for %s' % (getpass.getuser(), prog, secret))
|
||||
try:
|
||||
f = open("/etc/crans/secrets/" + secret)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue