Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFE: host context object #147

Open
Tiboris opened this issue Nov 5, 2021 · 0 comments
Open

RFE: host context object #147

Tiboris opened this issue Nov 5, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@Tiboris
Copy link
Member

Tiboris commented Nov 5, 2021

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)

@Tiboris Tiboris added the enhancement New feature or request label Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant