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

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

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
garethgreenaway added a commit to garethgreenaway/salt that referenced this pull request Sep 18, 2019
@waynew waynew added the has master-port port to master has been created label 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 port to master has been created
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants