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

Fix elasticsearch state module: allow user to define empty aliases #52943

Merged
merged 2 commits into from May 9, 2019

Conversation

@Ch3LL
Copy link
Contributor

commented May 8, 2019

What does this PR do?

This allows a user to define an empty aliases, mappings or settings in their definition set for the elasticsearch.index_template_present module

What issues does this PR fix or reference?

Fixes #51822

Previous Behavior

The state module would always return that there was changes even if the state was previously run.

logstash template:
  elasticsearch.index_template_present:
    - check_definition: true
    - definition:
        index_patterns: [ 'logstash-*' ]
        order: 0
        aliases: {}
local:
----------
          ID: logstash_template4
    Function: elasticsearch.index_template_present
      Result: True
     Comment: Successfully updated index template logstash_template4
     Started: 15:58:46.726069
    Duration: 37.978 ms
     Changes:   
              ----------
              new:
                  ----------
                  aliases:
                      ----------

Summary for local
------------
Succeeded: 1 (changed=1)
Failed:    0
------------
Total states run:     1
Total run time:  37.978 ms

New Behavior

can define an empty aliases, mappings or settings and it will now return no changes:

local:
----------
          ID: logstash_template4
    Function: elasticsearch.index_template_present
      Result: True
     Comment: Index template logstash_template4 is already present and up to date
     Started: 15:56:26.777195
    Duration: 23.914 ms
     Changes:   

Summary for local
------------
Succeeded: 1
Failed:    0
------------
Total states run:     1
Total run time:  23.914 ms

Tests written?

Yes

Commits signed with GPG?

Yes

@dwoz
dwoz approved these changes May 9, 2019
@dwoz dwoz merged commit 4437764 into saltstack:2019.2.1 May 9, 2019
10 checks passed
10 checks passed
WIP Ready for review
Details
continuous-integration/jenkins/pr-merge This commit looks good
Details
jenkins/pr/docs The docs job has passed
Details
jenkins/pr/lint Python lint test has passed
Details
jenkins/pr/py2-centos-7 The py2-centos-7 job has passed
Details
jenkins/pr/py2-ubuntu-1604 The py2-ubuntu-1604 job has passed
Details
jenkins/pr/py2-windows-2016 The py2-windows-2016 job has passed
Details
jenkins/pr/py3-centos-7 The py3-centos-7 job has passed
Details
jenkins/pr/py3-ubuntu-1604 The py3-ubuntu-1604 job has passed
Details
jenkins/pr/py3-windows-2016 The py3-windows-2016 job has passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.