Skip to content
This repository has been archived by the owner on Jul 26, 2021. It is now read-only.

Adding an Id context manager #7

Open
fgansevl opened this issue Jul 24, 2014 · 0 comments
Open

Adding an Id context manager #7

fgansevl opened this issue Jul 24, 2014 · 0 comments

Comments

@fgansevl
Copy link

Hi,
first: awesome work with NaCL/PyObjects
I was pondering myself about a Pythonic interface to Puppet when I came across salt/nacl

according to the docs you don't have an interface for reactor files yet.

My suggestion could help you with that

first, introducing the 'Id' context manager which maps to the highstate id key, so
the apache yaml example:

apache:
    pkg.installed
    service.running

would translate to

with Id('apache'):
    Pkg.installed()
    Service.running()

as you can see, it translates almost directly to the yaml example

when writing reactor files, you could do something like the following

sync_grains:
    cmd.saltutil.sync_grains:
        - tgt: {{ data['id'] }}

would become:

with Id('sync_grains'):
    Cmd.saltutil.sync_grains(tgt = data['id'])

ofcourse there are a lot of details to work out, but does this look 'workable' ?

Fred.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant