-
Notifications
You must be signed in to change notification settings - Fork 1.7k
AMBARI-24646 'ambari-server setup-ldap' fails with AttributeError when master_key is not persisted #2348
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
Conversation
…en master_key is not persisted (+ fix for AMBARI-24663)(dlysnichenko)
|
Refer to this link for build results (access rights to CI server needed): |
| os.chmod(tempFilePath, stat.S_IREAD | stat.S_IWRITE) | ||
|
|
||
| if options is not None and options.master_key is not None and options.master_key: | ||
| if options is not None and hasattr(options, 'master_key') and options.master_key is not None and options.master_key: |
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.
options.master_key is not None and options.master_keydo we need both checks?
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.
thanks, updated the patch
| try: | ||
| if options is not None and hasattr(options, 'master_key') and options.master_key is not None and options.master_key: | ||
| masterKey = options.master_key | ||
| if masterKey is None or masterKey == "": |
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.
can be simplified:
if not masterKey: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.
thanks, updated the patch
…en master_key is not persisted (+ fix for AMBARI-24663) - codestyle (dlysnichenko)
|
Refer to this link for build results (access rights to CI server needed): |
smolnar82
left a comment
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.
LGTM 👍
…n master_key is not persisted (apache#2348) * AMBARI-24646. 'ambari-server setup-ldap' fails with AttributeError when master_key is not persisted (+ fix for AMBARI-24663)(dlysnichenko) * AMBARI-24646. 'ambari-server setup-ldap' fails with AttributeError when master_key is not persisted (+ fix for AMBARI-24663) - codestyle (dlysnichenko)
NOTE: this patch also includes fix for AMBARI-24663
What changes were proposed in this pull request?
AMBARI-24646
STR
Installed ambari-server and configured password encryption, but chose not to persist master key
Then export environment variable
export AMBARI_SECURITY_MASTER_KEY=hadoop
Thereafter ran the following:
Issue #1 - Gave AttributeError after accepting the 'Save settings' prompt, instead of asking for master key
Issue #2 - Kept asking for Master key on the prompt, despite giving correct values
Issue #3 - Gave an incorrect master key this time and the shell kept on printing "ERROR: ERROR: Master key does not match." and kept scrolling the page
Note/Workaround: The issues are seen when master key is not persisted as part of the initial password encryption step
AMBARI-24663
STR
Installed ambari-server and configured password encryption, but chosed not to persist a master key
Then export an environment variable
export AMBARI_SECURITY_MASTER_KEY=hadoopambari-server setup prompts to enter current master key
How was this patch tested?
live cluster check and unit tests run