Skip to content

Commit

Permalink
Prefer security file over username/password
Browse files Browse the repository at this point in the history
  • Loading branch information
thotypous committed Aug 24, 2016
1 parent 8ea8c5a commit ef37614
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions storops/vnx/navi_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,11 @@ def is_credential_valid(self):
return self._is_credential_valid

def get_credentials(self):
if self._username is None and self._password is None:
if self._sec_file is not None:
# use security file
if self._sec_file is not None:
ret = text_var('-secfilepath', self._sec_file)
else:
ret = []
ret = text_var('-secfilepath', self._sec_file)
elif self._username is None and self._password is None:
ret = []
elif self._username is None or self._password is None:
self._is_credential_valid = False
raise ex.VNXCredentialError('username or password missing.')
Expand Down

0 comments on commit ef37614

Please sign in to comment.