Skip to content

Commit

Permalink
save a template
Browse files Browse the repository at this point in the history
  • Loading branch information
lee212 committed Oct 27, 2016
1 parent 8fa62a9 commit ac4cf04
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions simpleazure/template/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from datadiff.tools import assert_equal
from urlparse import urlparse
import urllib
import os

class Templates(OrderedDict):
_list = None
Expand Down Expand Up @@ -282,6 +283,11 @@ def read_template(self, path_or_uri):
template = json.loads(temp.read())
self.update(template)

def save(self, path):
with open(os.path.expanduser(path), "w") as f:
f.write(json.dumps(self, indent=4))
f.close()

class Deploy(object):
"""Constructs a :class:`Deploy <Deploy>`.
Returns :class:`Deploy <Deploy>` instance.
Expand Down

0 comments on commit ac4cf04

Please sign in to comment.