Skip to content

Instantly share code, notes, and snippets.

@johanek
Created October 24, 2014 08:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johanek/9bba906ea4889af6cfe8 to your computer and use it in GitHub Desktop.
Save johanek/9bba906ea4889af6cfe8 to your computer and use it in GitHub Desktop.
In [1]: import salt.config
In [2]: import salt.loader
In [3]: import salt.renderers.yaml
In [4]:
In [4]: content = open('test.sls').read()
In [5]: __opts__ = salt.config.minion_config('minion.conf')
In [6]: __salt__ = salt.loader.minion_mods(__opts__)
In [7]: salt.renderers.yaml.render(content)
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-7-eee27486c830> in <module>()
----> 1 salt.renderers.yaml.render(content)
/usr/local/lib/python2.7/site-packages/salt/renderers/yaml.pyc in render(yaml_data, saltenv, sls, argline, **kws)
63 data = {}
64 else:
---> 65 if isinstance(__salt__, dict):
66 if 'config.get' in __salt__:
67 if __salt__['config.get']('yaml_utf8', False):
NameError: global name '__salt__' is not defined
file_root: .
file_client: local
something:
file:
- managed
- source: salt://test/path
- owner: root
- group: root
- mode: 0644
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment