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

Support regex status types in http.query state #50150

Merged
merged 3 commits into from Oct 22, 2018

Conversation

mchugh19
Copy link
Contributor

@mchugh19 mchugh19 commented Oct 21, 2018

What does this PR do?

Adds status_type to http.query state to support pcre expressions

What issues does this PR fix or reference?

#50067

New Behavior

Supports states like the following (note status_type and status)

{% set statuses = [200, 201] %}
{% for status in statuses %}
verifty_status_{{ status }}:
  http.query:
    - name: http://the-internet.herokuapp.com/status_codes/{{ status }}
    - status: 200|201
    - status_type: pcre
    - match: "This page returned a"
{% endfor %}

Tests written?

Yes

Commits signed with GPG?

No

else:
ret['comment'] += ' Status {0} was not found.'.format(status)
ret['result'] = False
elif status_type == 'pcre':
Copy link
Contributor

@cachedout cachedout Oct 22, 2018

Choose a reason for hiding this comment

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

Can we combine this with the check for the string status type? It looks like the blocks are basically identical.

@cachedout cachedout merged commit 0a6e3d2 into saltstack:develop Oct 22, 2018
11 checks passed
garethgreenaway added a commit to garethgreenaway/salt that referenced this issue Sep 18, 2019
@waynew waynew added this to PR needs port to master in PRs to port to master Oct 17, 2019
@waynew waynew added the has master-port label Oct 17, 2019
@waynew waynew moved this from PR needs port to master to PR has port to master in PRs to port to master Oct 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has master-port
Projects
PRs to port to master
  
PR has port to master
Development

Successfully merging this pull request may close these issues.

None yet

3 participants