nacl
nacl copied to clipboard
{% import_json "auth/users.json" as users %}
Is there an equivalent for this code? Or should I just do:
with open('auth/users.json','r') as f: ...
?
What would be the most elegant way to translate this to pyobjects?
Thanks :)
I would just use simplejson directly.
import simplejson
users = simplejson.load(open('auth/users.json'))
Then you can do whatever you want with the users
object.
Awesome. :)
One little drawback is, that I can't use a relative path, and i can't use salt://, so i need to use /srv/salt/auth/users.json
But other than that, it works great and is so nice pythonic!
thanks :+1:
Good point.
I think the best thing to do would be to support salt://
paths anywhere in Pyobjects files. I'll see what I can do over the next little bit.
awesome :)
On Mon, Dec 15, 2014 at 4:48 PM, Evan Borgstrom [email protected] wrote:
Good point.
I think the best thing to do would be to support salt:// paths anywhere in Pyobjects files. I'll see what I can do over the next little bit.
— Reply to this email directly or view it on GitHub https://github.com/borgstrom/nacl/issues/8#issuecomment-67013743.