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

Draft: support slot parsing inside dict and lists of dict or strings #52351

Merged
merged 4 commits into from Apr 9, 2019

Conversation

mchugh19
Copy link
Contributor

@mchugh19 mchugh19 commented Mar 28, 2019

What does this PR do?

Adds support for parsing slots inside of dictionaries and dicts and strings inside of lists.
This enables slot support for subkeys

What issues does this PR fix or reference?

#51798
#50596

Previous Behavior

As mentioned in linked issues, slots were not parsed in subkeys of state files

The following states displays the slot text itself

slot test:
  file.managed:
    - name: /tmp/thing
    - source: salt://slot.jinja
    - template: jinja
    - context:
        custom_var: __slot__:salt:cmd.run('echo password')

test module stuff:
  module.run:
    - test.arg:
      - message: __slot__:salt:cmd.run('echo blah')

scheduled_slot:
  schedule.present:
    - function: test.arg
    - job_args:
        - __slot__:salt:cmd.run('echo "blah"')
    - cron: '* * * * *'

scheduled_slot2:
  schedule.present:
    - function: test.arg
    - job_kwargs:
        - message: __slot__:salt:cmd.run('echo "blah"')
    - cron: '* * * * *'

New Behavior

Previously mentioned state examples now show slot results

Tests written?

Yes

Commits signed with GPG?

No

@DmitryKuzmenko

Copy link
Contributor

@DmitryKuzmenko DmitryKuzmenko left a comment

I'm okay with this code.

salt/state.py Outdated Show resolved Hide resolved
@DmitryKuzmenko DmitryKuzmenko requested a review from thatch45 Apr 2, 2019
@DmitryKuzmenko
Copy link
Contributor

@DmitryKuzmenko DmitryKuzmenko commented Apr 2, 2019

@thatch45 could you please take a look at this?

@mchugh19
Copy link
Contributor Author

@mchugh19 mchugh19 commented Apr 4, 2019

Tests added

@thatch45
Copy link
Member

@thatch45 thatch45 commented Apr 9, 2019

For the record, this is fantastic and I wanted to get it in when I added slots but I just did not have the time. Is there anything blocking merging this?

@mchugh19
Copy link
Contributor Author

@mchugh19 mchugh19 commented Apr 9, 2019

@thatch45 As far as I know it's all set. There's also #52187 you might want to review as well.

@thatch45 thatch45 merged commit cd8d7a5 into saltstack:develop Apr 9, 2019
8 of 11 checks passed
@mchugh19 mchugh19 deleted the slot_hack branch Jul 4, 2019
mchugh19 pushed a commit to mchugh19/salt that referenced this issue Oct 13, 2019
Draft: support slot parsing inside dict and lists of dict or strings
@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

4 participants