Skip to content

Conversation

srids
Copy link
Collaborator

@srids srids commented Feb 20, 2018

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

@srids
Copy link
Collaborator Author

srids commented Feb 23, 2018

With this, PR #19 and PR #30 can be ignored/abandoned

@jimbobhickville
Copy link
Owner

@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?

@srids
Copy link
Collaborator Author

srids commented Feb 27, 2018 via email

@jimbobhickville
Copy link
Owner

I've added you on github. I'll need your pypi username to add you there so you can push out releases too.

@srids
Copy link
Collaborator Author

srids commented Feb 27, 2018 via email

@jimbobhickville
Copy link
Owner

Ok, you should be set. Just remember to increment the version number before running the build and release script or pypi will complain :D

@dimaspivak
Copy link
Collaborator

dimaspivak commented Mar 5, 2018

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. :)

@jimbobhickville
Copy link
Owner

That ok with you @srids?

@srids
Copy link
Collaborator Author

srids commented Mar 5, 2018

sure @jimbobhickville that will work best

previous_tag_item = (model.items[0] if (model.items and len(model.items) > 0) else None)
break

def uniquify(previous_tag_item, key, value):
Copy link
Collaborator

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.

def url(self):
return self.parent.url

def create(self, tag=None, **kwargs):
Copy link
Collaborator

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 :)

Copy link
Collaborator Author

@srids srids Mar 9, 2018

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

"""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"),
Copy link
Collaborator

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

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)
Copy link
Collaborator

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)?

# 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()))
Copy link
Collaborator

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

@srids srids merged commit 3d29488 into jimbobhickville:master Mar 12, 2018
rgannu added a commit to NGDATA/python-ambariclient that referenced this pull request Aug 19, 2019
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
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

Successfully merging this pull request may close these issues.

3 participants