-
Notifications
You must be signed in to change notification settings - Fork 79
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
must give password to set db in cli #281
Conversation
863849c
to
d5f7d20
Compare
@miq-bot remove-label wip |
@@ -182,13 +182,18 @@ def run | |||
|
|||
def set_db | |||
raise "No encryption key (v2_key) present" unless key_configuration.key_exist? | |||
raise "Must provide a password to set database" unless password? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can improve this sentence a bit ...
Maybe "A password is required to configure a database"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
def password? | ||
options[:password] && !options[:password].strip.empty? | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would below look more complicated or easer to read ? :
options[:password] ? !options[:password].strip.empty? : false
Also, I would fix style warning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine the way it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good @ailisp. Just fix up the rubocop complaints and we should be good to go. In this case you can either just add the spaces or (as the rest of this file seems to do), use |
e821f40
to
e462cfc
Compare
Checked commits ailisp/manageiq-gems-pending@b748667~...e462cfc with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.0 |
ISSUE: Currently we allow user to set up database in appliance console cli without given a password, which should be disallowed. This is part of BZ https://bugzilla.redhat.com/show_bug.cgi?id=1431815
Another part (disallow --internal without --dbdisk) is fixed in #277
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1431815#c2
\cc @yrudman @carbonin @gtanzillo
@miq-bot add-label wip, bug