Skip to content
Snippets Groups Projects
Commit 9d099698 authored by Guido Trotter's avatar Guido Trotter
Browse files

SimpleConfigReader: add docstrings


All non-oneliner functions, after this patch, have their docstring.

Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent a619a1dd
No related branches found
No related tags found
No related merge requests found
...@@ -186,6 +186,16 @@ class SimpleConfigReader(object): ...@@ -186,6 +186,16 @@ class SimpleConfigReader(object):
return master_candidate, drained, offline return master_candidate, drained, offline
def GetInstanceByLinkIp(self, ip, link): def GetInstanceByLinkIp(self, ip, link):
"""Get instance name from its link and ip address.
@type ip: string
@param ip: ip address
@type link: string
@param link: nic link
@rtype: string
@return: instance name
"""
if not link: if not link:
link = self.GetDefaultNicLink() link = self.GetDefaultNicLink()
if not link in self._ip_to_inst_by_link: if not link in self._ip_to_inst_by_link:
...@@ -227,6 +237,14 @@ class SimpleConfigReader(object): ...@@ -227,6 +237,14 @@ class SimpleConfigReader(object):
return self._mc_primary_ips return self._mc_primary_ips
def GetInstancesIps(self, link): def GetInstancesIps(self, link):
"""Get list of nic ips connected to a certain link.
@type link: string
@param link: nic link
@rtype: list
@return: list of ips connected to that link
"""
if not link: if not link:
link = self.GetDefaultNicLink() link = self.GetDefaultNicLink()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment