Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

discovery_auth should accept True as well #137

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

maurizio-lombardi
Copy link
Collaborator

@maurizio-lombardi maurizio-lombardi commented Sep 14, 2018

get discovery_auth is reporting True/False:

iscsi > get discovery_auth
DISCOVERY_AUTH CONFIG GROUP
enable=False

we should also be able to set it using True/False, not only 1 or 0.

Signed-off-by: Maurizio Lombardi [email protected]

iscsi> get discovery_auth
DISCOVERY_AUTH CONFIG GROUP
===========================
enable=False

we should also be able to set it using True/False

Signed-off-by: Maurizio Lombardi <[email protected]>
enable = 1
elif enable == 'False':
enable = 0
elif int(enable):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think the user know about python booleans always, so if they do false/true instead of False/True we will crash here due to int() not being able to convert it. I think it needs to be a enable.isdigit() or maybe a try/except ValueError to detect bad input. Whatever we normally do for input validation I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants