{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/26174","labels_url":"https://api.github.com/repos/saltstack/salt/issues/26174/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/26174/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/26174/events","html_url":"https://github.com/saltstack/salt/issues/26174","id":100108346,"number":26174,"title":"state.show_sls fails on new winrepo + jinja sls files","user":{"login":"TheBigBear","id":471105,"avatar_url":"https://avatars.githubusercontent.com/u/471105?v=3","gravatar_id":"","url":"https://api.github.com/users/TheBigBear","html_url":"https://github.com/TheBigBear","followers_url":"https://api.github.com/users/TheBigBear/followers","following_url":"https://api.github.com/users/TheBigBear/following{/other_user}","gists_url":"https://api.github.com/users/TheBigBear/gists{/gist_id}","starred_url":"https://api.github.com/users/TheBigBear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheBigBear/subscriptions","organizations_url":"https://api.github.com/users/TheBigBear/orgs","repos_url":"https://api.github.com/users/TheBigBear/repos","events_url":"https://api.github.com/users/TheBigBear/events{/privacy}","received_events_url":"https://api.github.com/users/TheBigBear/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/saltstack/salt/labels/Bug","name":"Bug","color":"e11d21"},{"url":"https://api.github.com/repos/saltstack/salt/labels/High%20Severity","name":"High Severity","color":"ff9143"},{"url":"https://api.github.com/repos/saltstack/salt/labels/P3","name":"P3","color":"0a3d77"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Platform","name":"Platform","color":"fef2c0"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Stretch","name":"Stretch","color":"FF1493"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Windows","name":"Windows","color":"006b75"}],"state":"open","locked":false,"assignee":{"login":"twangboy","id":9383935,"avatar_url":"https://avatars.githubusercontent.com/u/9383935?v=3","gravatar_id":"","url":"https://api.github.com/users/twangboy","html_url":"https://github.com/twangboy","followers_url":"https://api.github.com/users/twangboy/followers","following_url":"https://api.github.com/users/twangboy/following{/other_user}","gists_url":"https://api.github.com/users/twangboy/gists{/gist_id}","starred_url":"https://api.github.com/users/twangboy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twangboy/subscriptions","organizations_url":"https://api.github.com/users/twangboy/orgs","repos_url":"https://api.github.com/users/twangboy/repos","events_url":"https://api.github.com/users/twangboy/events{/privacy}","received_events_url":"https://api.github.com/users/twangboy/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/saltstack/salt/milestones/65","html_url":"https://github.com/saltstack/salt/milestones/Be%20-2","labels_url":"https://api.github.com/repos/saltstack/salt/milestones/65/labels","id":1278201,"number":65,"title":"Be -2","description":"","creator":{"login":"meggiebot","id":12242451,"avatar_url":"https://avatars.githubusercontent.com/u/12242451?v=3","gravatar_id":"","url":"https://api.github.com/users/meggiebot","html_url":"https://github.com/meggiebot","followers_url":"https://api.github.com/users/meggiebot/followers","following_url":"https://api.github.com/users/meggiebot/following{/other_user}","gists_url":"https://api.github.com/users/meggiebot/gists{/gist_id}","starred_url":"https://api.github.com/users/meggiebot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meggiebot/subscriptions","organizations_url":"https://api.github.com/users/meggiebot/orgs","repos_url":"https://api.github.com/users/meggiebot/repos","events_url":"https://api.github.com/users/meggiebot/events{/privacy}","received_events_url":"https://api.github.com/users/meggiebot/received_events","type":"User","site_admin":false},"open_issues":18,"closed_issues":9,"state":"open","created_at":"2015-08-28T19:34:51Z","updated_at":"2015-09-05T21:56:12Z","due_on":"2015-09-14T06:00:00Z","closed_at":null},"comments":13,"created_at":"2015-08-10T16:28:50Z","updated_at":"2015-09-08T16:50:45Z","closed_at":null,"body":"The new winrepo sls files can now contain jinja and do get rendered properly. Thanks @jfindlay.\r\n\r\nBut I just cannot figure how to use ```state.show_sls my-sls-file``` to see the final rendered output.\r\n\r\nAs-is, it gives a whole slurr of errors as follows:\r\n```salt-call --local win.repo.ccleaner```\r\n\r\n```python-traceback\r\nC:\\salt\\srv\\salt\\win\\repo>salt-call --local state.show_sls win.repo.ccleaner\r\n[INFO    ] Loading fresh modules for state activity\r\n[INFO    ] Fetching file from saltenv 'base', ** done ** 'win/repo/ccleaner.sls'\r\n[ERROR   ] An un-handled exception was caught by salt's global exception handler:\r\nAttributeError: 'float' object has no attribute 'startswith'\r\nTraceback (most recent call last):\r\n  File \"C:\\Python27\\lib\\runpy.py\", line 162, in _run_module_as_main\r\n    \"__main__\", fname, loader, pkg_name)\r\n  File \"C:\\Python27\\lib\\runpy.py\", line 72, in _run_code\r\n    exec code in run_globals\r\n  File \"c:\\python27\\scripts\\salt-call.exe\\__main__.py\", line 9, in <module>\r\n    sys.exit(salt_call())\r\n  File \"C:\\Python27\\lib\\site-packages\\salt\\scripts.py\", line 227, in salt_call\r\n    client.run()\r\n  File \"C:\\Python27\\lib\\site-packages\\salt\\cli\\call.py\", line 69, in run\r\n    caller.run()\r\n  File \"C:\\Python27\\lib\\site-packages\\salt\\cli\\caller.py\", line 236, in run\r\n    ret = self.call()\r\n  File \"C:\\Python27\\lib\\site-packages\\salt\\cli\\caller.py\", line 138, in call\r\n    ret['return'] = func(*args, **kwargs)\r\n  File \"C:\\Python27\\lib\\site-packages\\salt\\modules\\state.py\", line 980, in show_sls\r\n    high_, errors = st_.render_highstate({saltenv: mods})\r\n  File \"C:\\Python27\\lib\\site-packages\\salt\\state.py\", line 2808, in render_highstate\r\n    sls, saltenv, mods, matches)\r\n  File \"C:\\Python27\\lib\\site-packages\\salt\\state.py\", line 2548, in render_state\r\n    self._handle_state_decls(state, sls, saltenv, errors)\r\n  File \"C:\\Python27\\lib\\site-packages\\salt\\state.py\", line 2704, in _handle_state_decls\r\n    if key.startswith('_'):\r\nAttributeError: 'float' object has no attribute 'startswith'\r\nTraceback (most recent call last):\r\n  File \"C:\\Python27\\lib\\runpy.py\", line 162, in _run_module_as_main\r\n    \"__main__\", fname, loader, pkg_name)\r\n  File \"C:\\Python27\\lib\\runpy.py\", line 72, in _run_code\r\n    exec code in run_globals\r\n  File \"c:\\python27\\scripts\\salt-call.exe\\__main__.py\", line 9, in <module>\r\n  File \"C:\\Python27\\lib\\site-packages\\salt\\scripts.py\", line 227, in salt_call\r\n    client.run()\r\n  File \"C:\\Python27\\lib\\site-packages\\salt\\cli\\call.py\", line 69, in run\r\n    caller.run()\r\n  File \"C:\\Python27\\lib\\site-packages\\salt\\cli\\caller.py\", line 236, in run\r\n    ret = self.call()\r\n  File \"C:\\Python27\\lib\\site-packages\\salt\\cli\\caller.py\", line 138, in call\r\n    ret['return'] = func(*args, **kwargs)\r\n  File \"C:\\Python27\\lib\\site-packages\\salt\\modules\\state.py\", line 980, in show_sls\r\n    high_, errors = st_.render_highstate({saltenv: mods})\r\n  File \"C:\\Python27\\lib\\site-packages\\salt\\state.py\", line 2808, in render_highstate\r\n    sls, saltenv, mods, matches)\r\n  File \"C:\\Python27\\lib\\site-packages\\salt\\state.py\", line 2548, in render_state\r\n    self._handle_state_decls(state, sls, saltenv, errors)\r\n  File \"C:\\Python27\\lib\\site-packages\\salt\\state.py\", line 2704, in _handle_state_decls\r\n    if key.startswith('_'):\r\nAttributeError: 'float' object has no attribute 'startswith'\r\n```\r\n\r\nIf I add `#!yaml` to the first line, I get \r\n```\r\nC:\\salt\\srv\\salt\\win\\repo>salt-call --local state.show_sls win.repo.ccleaner\r\n[INFO    ] Loading fresh modules for state activity\r\n[INFO    ] Fetching file from saltenv 'base', ** done ** 'win/repo/ccleaner.sls'\r\n[CRITICAL] Rendering SLS 'base:win.repo.ccleaner' failed: found character '%' that cannot start any token; line 3\r\n\r\n---saltstack\r\n#!yaml\r\n# just 32-bit x86 installer available\r\n{% if grains['cpuarch'] == 'AMD64' %}    <======================\r\n    {% set PROGRAM_FILES = \"C:\\Program Files (x86)\" %}\r\n{% else %}\r\n    {% set PROGRAM_FILES = \"C:\\Program Files\" %}\r\n{% endif %}\r\nccleaner:\r\n[...]\r\n---\r\nlocal:\r\n    - Rendering SLS 'base:win.repo.ccleaner' failed: found character '%' that cannot start any token; line 3\r\n    -\r\n    - ---\r\n    - #!yaml\r\n    - # just 32-bit x86 installer available\r\n    - {% if grains['cpuarch'] == 'AMD64' %}    <======================\r\n    -     {% set PROGRAM_FILES = \"C:\\Program Files (x86)\" %}\r\n    - {% else %}\r\n    -     {% set PROGRAM_FILES = \"C:\\Program Files\" %}\r\n    - {% endif %}\r\n    - ccleaner:\r\n    - [...]\r\n    - ---\r\n```\r\n\r\nAnd if I add a first line of `#!jinja` it gives me:\r\n\r\n\r\n```\r\nC:\\salt\\srv\\salt\\win\\repo>salt-call --local state.show_sls win.repo.ccleaner\r\n[INFO    ] Loading fresh modules for state activity\r\n[INFO    ] Fetching file from saltenv 'base', ** done ** 'win/repo/ccleaner.sls'\r\nlocal:\r\n    - SLS win.repo.ccleaner does not render to a dictionary\r\n\r\nC:\\salt\\srv\\salt\\win\\repo>\r\n```\r\n\r\nThe ```ccleaner.sls``` comes from salt-winrepo's WIP_Berryllium+jinja branch. (https://github.com/saltstack/salt-winrepo/blob/WIP_Berryllium%2Bjinja/ccleaner.sls)\r\n\r\n```salt-call --versions``` is:\r\n\r\n```yaml\r\nC:\\salt\\srv\\salt\\win\\repo>salt-call --local --versions\r\n           Salt: 2015.5.3\r\n         Python: 2.7.8 (default, Jun 30 2014, 16:08:48) [MSC v.1500 64 bit (AMD64)]\r\n         Jinja2: 2.8\r\n       M2Crypto: Not Installed\r\n msgpack-python: 0.4.6\r\n   msgpack-pure: 0.1.3\r\n       pycrypto: 2.6.1\r\n        libnacl: 1.4.3\r\n         PyYAML: 3.11\r\n          ioflo: 1.3.8\r\n          PyZMQ: 14.7.0\r\n           RAET: 0.6.3\r\n            ZMQ: 4.1.2\r\n           Mako: 1.0.1\r\n        Tornado: 4.2.1\r\n```\r\n@jfindlay @twangboy @UtahDave any idea what it takes to enable ```state.show_sls``` to work on the new jinja allowed/included style winrepo sls files?"},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/138630677","html_url":"https://github.com/saltstack/salt/issues/26174#issuecomment-138630677","issue_url":"https://api.github.com/repos/saltstack/salt/issues/26174","id":138630677,"user":{"login":"TheBigBear","id":471105,"avatar_url":"https://avatars.githubusercontent.com/u/471105?v=3","gravatar_id":"","url":"https://api.github.com/users/TheBigBear","html_url":"https://github.com/TheBigBear","followers_url":"https://api.github.com/users/TheBigBear/followers","following_url":"https://api.github.com/users/TheBigBear/following{/other_user}","gists_url":"https://api.github.com/users/TheBigBear/gists{/gist_id}","starred_url":"https://api.github.com/users/TheBigBear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheBigBear/subscriptions","organizations_url":"https://api.github.com/users/TheBigBear/orgs","repos_url":"https://api.github.com/users/TheBigBear/repos","events_url":"https://api.github.com/users/TheBigBear/events{/privacy}","received_events_url":"https://api.github.com/users/TheBigBear/received_events","type":"User","site_admin":false},"created_at":"2015-09-08T16:50:45Z","updated_at":"2015-09-08T16:50:45Z","body":"@twangboy on the centos 7.1 linux server it got both ```/srv/salt/win/repo``` and ```/srv/salt/win/repo-ng``` [and on the windows minion the git repos are in 'c:\\salt\\srv\\salt\\win'] if your cmd was supposed to run on the windows minion, then it does not render for me on my windows minion. \r\nany special/extra config assumed on the windows minion?"}}