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

Adding an Id context manager #7

@fgansevl

Description

@fgansevl

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions