Skip to content

Bug/26/no node lookup when wan_only is enabled - #28

Open
avlahop wants to merge 3 commits into
avlahop:masterfrom
ibnubay:bug/26/no_node_lookup_when_wan_only
Open

avlahop wants to merge 3 commits into
avlahop:masterfrom
ibnubay:bug/26/no_node_lookup_when_wan_only

Conversation

@avlahop

@avlahop avlahop commented Jan 2, 2021

Copy link
Copy Markdown
Owner

No description provided.

avlach and others added 2 commits January 2, 2021 18:53
from outside the cluster

- Catch exception when key error and inform user
- Check for nodes only when wan_only is False
@avlahop avlahop changed the title Bug/26/no node lookup when wan only Bug/26/no node lookup when wan_only is enabled Jan 2, 2021
@avlahop

avlahop commented Jan 2, 2021

Copy link
Copy Markdown
Owner Author

Could you please write a test that that checks that a node with the id is added but the "publish_address" value is None when wan_only is True?

"""

:param elasticsearch.Elasticsearch elk_client: Instance of an
Elasticsearch client to connect to

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

can you add wan_only doc string here as well?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Done, I hope it correct like what you want

@avlahop avlahop assigned avlahop and unassigned avlahop Jan 2, 2021
@avlahop avlahop added the bug Something isn't working label Jan 2, 2021
@avlahop avlahop linked an issue Jan 2, 2021 that may be closed by this pull request
@avlahop avlahop closed this Jan 2, 2021
@avlahop avlahop reopened this Jan 2, 2021
def get_nodes_from_elastic(self, elk_client):
def get_nodes_from_elastic(self, elk_client, wan_only):
"""
if wan_only value is True, then set None on publish_address

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Please add it as parameter in the doc string bellow like elk_client e.g

:param bool wan_only: Whether DaskElkClient is connected in wan_only mode or not

This doc strings is necessary for the documentation to be correctly created.
You can add it under the elk_client param entry in the doc string

self.assertEqual("E43TT5r9Q9-VWckuAXLf0Q", node.node_id)
self.assertEqual("1.1.1.1:9200", node.publish_address)
self.assertEqual(("master", "data", "ingest"), node.node_type)

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Can you add a test here? You can use the test above and below for examples. You should call get_nodes_from_elastic with wan_only=True. You should expecgt the node's publish address to be None so you could check something like

self.assertIsNone(node.publish_address)

All the other assertions should probably be the same.

return self.__nodes

def get_nodes_from_elastic(self, elk_client):
def get_nodes_from_elastic(self, elk_client, wan_only):

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I would prefer if you set this with default value to False So it won't break any call to get_nodes_from_elastic without passing wan_only parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failed connect to elasticsearch manage by aws behind VPN

2 participants