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

A method for every single openstack command? #5

Closed
thutterer opened this issue May 5, 2015 · 6 comments
Closed

A method for every single openstack command? #5

thutterer opened this issue May 5, 2015 · 6 comments

Comments

@thutterer
Copy link

Only a few commands have been implemented so far:
993baf2
48519ca
But we already have code duplications and differences:
ab689c1
And looking at the length of the list of openstack commands, we should consider a more generic way to implement these helpers, e.g. the code for listing users and images is basically the same and should be reusable when I want to list tenants (projects).

@vmoravec
Copy link

vmoravec commented May 5, 2015

In general I agree with you, I just did not want to optimize these things too early and too much as we have currently only 2 openstackclient commands covered.

@thutterer
Copy link
Author

Yes, but I'd need project now and the necessary code for introducing openstack project list or show functionality would be only duplication.
Those to sub-commands should be inherited from some parent class, don't you think?

@vmoravec
Copy link

vmoravec commented May 5, 2015

Or module that is included into the context. We're already including NodeContext into the commands classes, we might add them there (or into a new module that is included into the NodeContext): https://github.com/SUSE-Cloud/cct/blob/master/lib/cct/commands/openstack.rb#L22

Or would you rather convert that module into a class and inherit from it for every openstackclient command (I mean here this class: https://github.com/SUSE-Cloud/cct/blob/master/lib/cct/commands/openstack/user.rb#L4) ?

@thutterer
Copy link
Author

Puh, that's a design questions on which I don't have any particular opinion.

@vmoravec
Copy link

vmoravec commented May 6, 2015

This is the proposal to simpify the commands' implementation: Add openstack client refactored api

@thutterer
Copy link
Author

Thanks for improving this right away!

Edit: I just saw the PR isn't merged yet but I keep this issue closed as this will eventually go into master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants