AMBARI-24646 'ambari-server setup-ldap' fails with AttributeError when master_key is not persisted#2348
Merged
2 commits merged intoSep 20, 2018
Merged
AMBARI-24646 'ambari-server setup-ldap' fails with AttributeError when master_key is not persisted#23482 commits merged into
2 commits merged into
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): |
zeroflag
reviewed
Sep 20, 2018
| 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: |
Contributor
There was a problem hiding this comment.
options.master_key is not None and options.master_keydo we need both checks?
rlevas
approved these changes
Sep 20, 2018
zeroflag
reviewed
Sep 20, 2018
| 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 == "": |
Contributor
There was a problem hiding this comment.
can be simplified:
if not masterKey:
zeroflag
approved these changes
Sep 20, 2018
…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): |
vishalsuvagia
pushed a commit
to vishalsuvagia/ambari
that referenced
this pull request
Oct 1, 2018
…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)
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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