diff options
author | Lars Wirzenius <liw@liw.fi> | 2017-03-26 14:05:42 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2017-03-26 14:05:42 +0300 |
commit | 7c1ad52dd01c1f58fc7d08c0a4880ab51960718d (patch) | |
tree | 1f5713e7c406ecef9be9513619331bbcd71c615d | |
parent | c12d0f69299f02e0a28ac5cd75b9d757469990b4 (diff) | |
download | vmdb2-7c1ad52dd01c1f58fc7d08c0a4880ab51960718d.tar.gz |
Make State.as_dict return everything not initially there
-rw-r--r-- | vmdb/state.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/vmdb/state.py b/vmdb/state.py index d9f3840..d64244d 100644 --- a/vmdb/state.py +++ b/vmdb/state.py @@ -18,9 +18,13 @@ class State(object): + def __init__(self): + self._attrs = {} # make sure this attribute exists + self._attrs = self.as_dict() + def as_dict(self): return { key: getattr(self, key) for key in dir(self) - if not key.startswith('_') and not key == 'as_dict' + if not key in self._attrs } |