Skip to content
This repository has been archived by the owner on Aug 12, 2019. It is now read-only.

Ds10 #21

Open
wants to merge 5 commits into
base: ds10
Choose a base branch
from
Open

Ds10 #21

wants to merge 5 commits into from

Conversation

uover82
Copy link

@uover82 uover82 commented Apr 23, 2018

Hi,

I've extended your sdk with support for adding/ getting tenants, tenant_templates - please merge into your ds10 branch, if you'd like.

Let me know of any updates/ issues/ questions - thanks for creating/ maintaining!

John

Copy link

@theherk theherk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am going to submit some feedback @uover82. (I work with @uover82) Most of this is totally trivial. All told the request looks good, and I'll be interested to see the feedback from the authors.

Copy link

@theherk theherk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes seem good and follow the libraries implementation elsewhere very well. Great that you included tests.

The only comments I had are very minor and should affect operation at all. There are some indentation and spacing issues. Package names often discourage underscores, but for variables tenantname, for example, would typically be tenant_name, but this is fine too. These may not be the case throughout the library, and consistency is more important.

Looks good to me. Edits are up to you. I'll be anxious to hear feedback from the maintainers.

self.log("Making a REST PUT request with headers {}".format(headers), level='debug')
else:
request_type = 'POST'
self.log("Making a REST POST request with headers {}".format(headers), level='debug')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For starters, this is indented by two spaces which should be corrected to four. Next, the third parameter to setattr, lambda: 'PUT' doesn't really make sense to me. Why not just setattr(url_request, 'get_method', 'PUT')?


response = self.manager._request(rest_call, auth_required=False)

return response
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is one of those trivial things, but if response isn't used beyond the return, why not return the call to _request rather than setting a variable?

core.CoreObject.__init__(self)
self.manager = manager
self.log = self.manager.log if self.manager else None
if api_response: self._set_properties(api_response, log_func)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding style question for the maintainers, but I think the newline makes this more clear unless using the full ternary.

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

Successfully merging this pull request may close these issues.

2 participants