Commit c81d7bda by Dudás Ádám

vm: add note explaining __getattr__

parent c6123413
...@@ -255,6 +255,8 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, ...@@ -255,6 +255,8 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel,
self.instance = instance self.instance = instance
def __getattr__(self, name): def __getattr__(self, name):
# NOTE: __getattr__ is only called if the attribute doesn't already
# exist in your __dict__
if name in self._ops: if name in self._ops:
return self._ops[name](self) return self._ops[name](self)
else: else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment