-
Notifications
You must be signed in to change notification settings - Fork 31
config update support, cluster start fix, cluster service/stop .. #34
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
Conversation
…one not provided)
@srids - I don't really maintain this any more as the product I was working on that utilized it was shut down and I've switched jobs. Would you like to be added as a collaborator to help maintain it in the future? |
sure absolutely Greg. Much thanks for getting us the head start :)
… On Feb 27, 2018, at 2:12 PM, Greg Hill ***@***.***> wrote:
@srids <https://github.com/srids> - I don't really maintain this any more as the product I was working on that utilized it was shut down and I've switched jobs. Would you like to be added as a collaborator to help maintain it in the future?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#34 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AVMj9HwWe3hWTKfOpcbp8E28gaOAQ7bxks5tZH3bgaJpZM4SMdTM>.
|
I've added you on github. I'll need your pypi username to add you there so you can push out releases too. |
awesome - thanks. its: srids
… On Feb 27, 2018, at 3:00 PM, Greg Hill ***@***.***> wrote:
I've added you on github. I'll need your pypi username to add you there so you can push out releases too.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#34 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AVMj9ByCratpa4jkxOIncIZ5DvwQMoOcks5tZIkVgaJpZM4SMdTM>.
|
Ok, you should be set. Just remember to increment the version number before running the build and release script or pypi will complain :D |
Hey @jimbobhickville wanna add me as a collaborator, as well? I'm also sitting on a list of changes in a fork and this way @srids and I can do reviews for each other and keep your baby alive. :) |
That ok with you @srids? |
sure @jimbobhickville that will work best |
ambariclient/models.py
Outdated
previous_tag_item = (model.items[0] if (model.items and len(model.items) > 0) else None) | ||
break | ||
|
||
def uniquify(previous_tag_item, key, value): |
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.
Perhaps this just be moved into a function in utils.py
? I'm also a bit unclear as to its purpose and how it handles attributes of type dict
, list
, and other. Can you add some documentation around the intended use? If it simplifies things, I'd prefer to just handle one kind of type (if possible) to just keep the complexity down.
ambariclient/models.py
Outdated
def url(self): | ||
return self.parent.url | ||
|
||
def create(self, tag=None, **kwargs): |
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 we add a little more documentation describing this function? I know Ambari has a nightmarish way of handling configuration changes, so sharing the knowledge you've clearly picked up the hard way would be useful to everyone :)
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.
gave few comments before and added a docstring with some more details
ambariclient/models.py
Outdated
"""Restart all required components resulting from stale configs""" | ||
self.load(self.client.post(self.cluster.requests.url, data={ | ||
"RequestInfo": { | ||
"context": (context if context else "Restart All Required"), |
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 use context or 'Restart All Required'
instead
ambariclient/models.py
Outdated
def uniquify(previous_tag_item, key, value): | ||
attrib_value = None | ||
if previous_tag_item: | ||
attrib_value = (previous_tag_item[key] if key in previous_tag_item else None) |
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 probably do previous_tag_item.get(key)
?
ambariclient/models.py
Outdated
# a PUT to "http://localhost:8080/api/v1/clusters/cluster" | ||
# in format as: [{"Clusters":{"desired_config":[{"type":"core-site", "tag":"somrandchars", | ||
# "properties":{"hadoop.proxyuser.xyz.groups" : "*", ... }]}}] | ||
new_tag = (tag if tag else str(time.time())) |
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.
tag or str(time.time())
should work
We no longer need to have our fork of python-ambariclient. Changes done in this branch have been merged along with the ticket jimbobhickville#34 We can start using 0.6.0
this PR has few features which overlap and likely fix other pending PRs. more:
PR #19 : have some changes from this one here and have fixes for the stop service and config updates logic
PR #30 : needed this for our automation. so have that change here too
additionally have support for restarting components which have stale configs.
addresses my previously raised issue #33