-
Notifications
You must be signed in to change notification settings - Fork 27
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
rename storages to ceph #71
Conversation
@@ -14,23 +14,22 @@ | |||
# limitations under the License. | |||
# | |||
|
|||
class Api::StoragesController < ApiController | |||
class Api::CephController < ApiController |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/ClassAndModuleChildren: Use nested module/class definitions instead of compact style.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I agree with Hound here. I've seen problems in the past caused by not following this guideline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added to cleanup card https://trello.com/c/8p1DvJQ2/1931-cleanup-upgrade-related-api as we have to change it in multiple places (in other files/repos as well)
3ff41c2
to
b57f199
Compare
before_action :set_ceph | ||
|
||
api :GET, "/api/storages", "List all Ceph storages" | ||
api :GET, "/api/ceph", "Show the Ceph object" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I do not like the "object", it looks like something inside ceph storage. What about "configuration"? (Not much better...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that something less vague would be better. What does the API call return, exactly? Ideally the description should clearly reflect that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right now nothing, but it should display some general data (see also GET /api/crowbar). what about returning the ceph version for a start?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just saw that we don't store the ceph version anywhere as far as i could see. but lets just drop this endpoint for now as we don't really have a use case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM (I think - my Rails routes knowledge is a bit out of date) - just one or two minor nitpicks.
@@ -14,23 +14,22 @@ | |||
# limitations under the License. | |||
# | |||
|
|||
class Api::StoragesController < ApiController | |||
class Api::CephController < ApiController |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I agree with Hound here. I've seen problems in the past caused by not following this guideline.
before_action :set_ceph | ||
|
||
api :GET, "/api/storages", "List all Ceph storages" | ||
api :GET, "/api/ceph", "Show the Ceph object" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that something less vague would be better. What does the API call return, exactly? Ideally the description should clearly reflect that.
826c414
to
47ebfc0
Compare
+1 |
@MaximilianMeister It seems that github's new features still have some bugs to iron out ;-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rename looks fine but I'm a bit puzzled about the design of the code which already existed before this PR.
@@ -15,7 +15,7 @@ | |||
# | |||
|
|||
module Api | |||
class Storage < Tableless | |||
class Ceph < Tableless | |||
def repocheck |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this an instance method rather than a class method?
protected | ||
|
||
def set_ceph | ||
@ceph = Api::Ceph.new |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this PR isn't introducing or even really changing this, but I don't understand why it's an instance method or why an instance variable is being assigned, since I can't see any instance-specific state. Am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good that you mention that, I already thought about this as well. I added a task to the cleanup trellocard
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
b38ddb2
to
755e2ca
Compare
the barclamp name fits better than the abstracted name
755e2ca
to
3f9527c
Compare
rebased and added an example to the api doc (according to crowbar/crowbar-core#682) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you splitt this change into two separate PRs? This are two totally different topics.
de591b2
to
3f9527c
Compare
dropped the commit |
@aspiers ping |
the barclamp name fits better than the abstracted name