Skip to content

Commit

Permalink
init to load json inline or from file
Browse files Browse the repository at this point in the history
  • Loading branch information
lee212 committed Oct 27, 2016
1 parent a77a56e commit 8fa62a9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions simpleazure/template/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,15 @@ class Template(dict):
special_placeholders = [ 'GEN-UNIQUE', 'GEN-UNIQUE-', 'GEN-SSH-PUB-KEY', 'GEN-PASSWORD' ]
dependency = None

def __init__(self, data_or_filepath=None):
if data_or_filepath:
if isinstance(data_or_filepath, dict):
self.update(data_or_filepath)
try:
self.read_template(date_or_filepath)
except:
pass

def metadata(self):
return pd.Series(self['metadata'])

Expand Down

0 comments on commit 8fa62a9

Please sign in to comment.