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

Add Pyobjects (formerly NaCl) to Salt #10517

Merged
merged 5 commits into from
Feb 18, 2014
Merged

Conversation

borgstrom
Copy link
Contributor

This adds a new renderer #!pyobjects that provides an object based interface for building state data.

See the following for more background:

@ghost
Copy link

ghost commented Feb 18, 2014

Test FAILed.
Refer to this link for build results: http://jenkins.saltstack.com/job/salt-pr-build/1560/

@whiteinge
Copy link
Contributor

Nice!

from salt.loader import states
from salt.utils.pyobjects import StateFactory, StateRegistry

log = logging.getLogger("pyobjects")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you please switch to:

log = logging.getLogger(__name__)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, I switched to "pyobjects" during testing to ensure I was getting log messages at one point. This has been switched back to name.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Awesome!

@s0undt3ch
Copy link
Collaborator

Aside from my comment(minor change), I think this is awesome!

@ghost
Copy link

ghost commented Feb 18, 2014

Test FAILed.
Refer to this link for build results: http://jenkins.saltstack.com/job/salt-pr-build/1565/

@ghost
Copy link

ghost commented Feb 18, 2014

Test FAILed.
Refer to this link for build results: http://jenkins.saltstack.com/job/salt-pr-build/1566/

thatch45 added a commit that referenced this pull request Feb 18, 2014
Add Pyobjects (formerly NaCl) to Salt
@thatch45 thatch45 merged commit a2a4ead into saltstack:develop Feb 18, 2014
@thatch45
Copy link
Contributor

I really like this! Thanks @borgstrom! I am wondering if this works with the top file, and if not if it could be extended to do so.

@basepi, we can cherry this into 2014.1

@borgstrom borgstrom deleted the pyobjects branch February 18, 2014 20:27
@borgstrom
Copy link
Contributor Author

Thanks! Is there anything else you'd recommend I do from a documentation
standpoint?
On Feb 18, 2014 1:13 PM, "Thomas S Hatch" [email protected] wrote:

I really like this! Thanks @borgstrom https://github.com/borgstrom! I
am wondering if this works with the top file, and if not if it could be
extended to do so.

@basepi https://github.com/basepi, we can cherry this into 2014.1

Reply to this email directly or view it on GitHubhttps://github.com//pull/10517#issuecomment-35414787
.

@erchn
Copy link
Contributor

erchn commented Feb 20, 2014

Are there any docs on how salt modules would be called, or how to reference pillar data? if it's like a normal #!py that's fine, though it seems less than ideal given how nicely states are presented.

Sorry if this is too obvious, but I'm unclear how includes would work as well.

@borgstrom
Copy link
Contributor Author

@erchn currently you access salt & pillar the same way as the other renderers, through the default objects that Salt provides (ie. salt['cmd.run'](bar)). However, I did just submit a pull request (#10600) to add an object interface to Salt (Salt.cmd.run(bar)). I supposed adding a Pillar object that provides a simple proxy to the pillar.get Salt function might be a nice touch, (ie. salt['pillar.get']('foo:bar:baz', 'qux') and Pillar('foo:bar:baz', 'qux') would be functionally equivalent)

Includes & Extends are documented in the renderer (https://github.com/saltstack/salt/blob/develop/salt/renderers/pyobjects.py#L91)

borgstrom added a commit to borgstrom/salt that referenced this pull request Feb 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ZZZ[Done]-back-ported-bf RETIRED The pull request has been back-ported to an older branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants