mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-05-28 04:04:39 -04:00
Ensure get_password is accessing a file that exists.
This commit is contained in:
parent
17e19dfce6
commit
cd34d8f80d
1 changed files with 2 additions and 2 deletions
|
|
@ -920,9 +920,9 @@ def setup_tokens(token, username, user):
|
|||
def get_password(csv_fname, user):
|
||||
'''Get the password of user within the csv file provided.'''
|
||||
root_cdk = '/root/cdk'
|
||||
if not os.path.isdir(root_cdk):
|
||||
return None
|
||||
tokens_fname = os.path.join(root_cdk, csv_fname)
|
||||
if not os.path.isfile(tokens_fname):
|
||||
return None
|
||||
with open(tokens_fname, 'r') as stream:
|
||||
for line in stream:
|
||||
record = line.split(',')
|
||||
|
|
|
|||
Loading…
Reference in a new issue