We should probably create some kind of context object, e.g. in up action or transformer. Then pass all the relevant objects in it - the ones which are input and the ones which are ooutput of the operations. Then the code would be simpler and we would not need to enhance the Host object with additional data which are in metadata.
E.g.
class HostProvisioningContext:
def __init__(self, name, req, meta_host):
self.name = name
self.req = req
self.meta_host = meta_host
self.spec = None
self.result = None
self.error = None
@property
def ok(self):
"""If provisioning resulted in success."""
return self.error != None
Originally posted by @pvoborni in #144 (comment)
We should probably create some kind of context object, e.g. in
upaction or transformer. Then pass all the relevant objects in it - the ones which are input and the ones which are ooutput of the operations. Then the code would be simpler and we would not need to enhance the Host object with additional data which are in metadata.E.g.
Originally posted by @pvoborni in #144 (comment)