fixed formatting in docs due
This commit is contained in:
parent
5490f961a6
commit
b8ded52a66
23 changed files with 106 additions and 109 deletions
|
@ -91,7 +91,7 @@ class CoreEmu:
|
|||
:param _id: session id for new session
|
||||
:param _cls: Session class to use
|
||||
:return: created session
|
||||
"""
|
||||
"""
|
||||
if not _id:
|
||||
_id = 1
|
||||
while _id in self.sessions:
|
||||
|
@ -107,7 +107,7 @@ class CoreEmu:
|
|||
|
||||
:param _id: session id to delete
|
||||
:return: True if deleted, False otherwise
|
||||
"""
|
||||
"""
|
||||
logging.info("deleting session: %s", _id)
|
||||
session = self.sessions.pop(_id, None)
|
||||
result = False
|
||||
|
|
|
@ -200,7 +200,7 @@ class DistributedController:
|
|||
:param server: server to create
|
||||
tunnel for
|
||||
:return: local and remote gre taps created for tunnel
|
||||
"""
|
||||
"""
|
||||
host = server.host
|
||||
key = self.tunnel_key(node.id, netaddr.IPAddress(host).value)
|
||||
tunnel = self.tunnels.get(key)
|
||||
|
@ -237,7 +237,7 @@ class DistributedController:
|
|||
:param n1_id: node one id
|
||||
:param n2_id: node two id
|
||||
:return: tunnel key for the node pair
|
||||
"""
|
||||
"""
|
||||
logging.debug("creating tunnel key for: %s, %s", n1_id, n2_id)
|
||||
key = (
|
||||
(self.session.id << 16) ^ utils.hashkey(n1_id) ^ (utils.hashkey(n2_id) << 8)
|
||||
|
|
|
@ -217,7 +217,7 @@ class InterfaceData:
|
|||
Returns a list of ip4 and ip6 address when present.
|
||||
|
||||
:return: list of addresses
|
||||
"""
|
||||
"""
|
||||
ip4 = self.ip4_address()
|
||||
ip6 = self.ip6_address()
|
||||
return [i for i in [ip4, ip6] if i]
|
||||
|
@ -252,7 +252,7 @@ class IpPrefixes:
|
|||
|
||||
:param node: node to get IP4 address for
|
||||
:return: IP4 address or None
|
||||
"""
|
||||
"""
|
||||
if not self.ip4:
|
||||
raise ValueError("ip4 prefixes have not been set")
|
||||
return str(self.ip4[node.id])
|
||||
|
@ -263,7 +263,7 @@ class IpPrefixes:
|
|||
|
||||
:param node: node to get IP6 address for
|
||||
:return: IP4 address or None
|
||||
"""
|
||||
"""
|
||||
if not self.ip6:
|
||||
raise ValueError("ip6 prefixes have not been set")
|
||||
return str(self.ip6[node.id])
|
||||
|
@ -280,7 +280,7 @@ class IpPrefixes:
|
|||
:param mac: mac address to use for this interface, default is random
|
||||
generation
|
||||
:return: new interface data for the provided node
|
||||
"""
|
||||
"""
|
||||
# interface id
|
||||
inteface_id = node.newifindex()
|
||||
|
||||
|
|
|
@ -199,7 +199,7 @@ class Session:
|
|||
:param node_one_id: node one id
|
||||
:param node_two_id: node two id
|
||||
:return: nodes, network nodes if present, and tunnel if present
|
||||
"""
|
||||
"""
|
||||
logging.debug(
|
||||
"link message between node1(%s) and node2(%s)", node_one_id, node_two_id
|
||||
)
|
||||
|
@ -1254,7 +1254,7 @@ class Session:
|
|||
|
||||
:param state: flag to determine if session state should be included
|
||||
:return: environment variables
|
||||
"""
|
||||
"""
|
||||
env = os.environ.copy()
|
||||
env["SESSION"] = str(self.id)
|
||||
env["SESSION_SHORT"] = self.short_session_id()
|
||||
|
@ -1374,7 +1374,7 @@ class Session:
|
|||
|
||||
:param _id: id of node to delete
|
||||
:return: True if node deleted, False otherwise
|
||||
"""
|
||||
"""
|
||||
# delete node and check for session shutdown if a node was removed
|
||||
logging.info("deleting node(%s)", _id)
|
||||
node = None
|
||||
|
@ -1610,7 +1610,7 @@ class Session:
|
|||
request flag.
|
||||
|
||||
:return: service boot exceptions
|
||||
"""
|
||||
"""
|
||||
with self._nodes_lock:
|
||||
funcs = []
|
||||
start = time.monotonic()
|
||||
|
@ -1631,7 +1631,7 @@ class Session:
|
|||
Retrieve control net prefixes.
|
||||
|
||||
:return: control net prefix list
|
||||
"""
|
||||
"""
|
||||
p = self.options.get_config("controlnet")
|
||||
p0 = self.options.get_config("controlnet0")
|
||||
p1 = self.options.get_config("controlnet1")
|
||||
|
@ -1646,7 +1646,7 @@ class Session:
|
|||
Retrieve control net server interfaces.
|
||||
|
||||
:return: list of control net server interfaces
|
||||
"""
|
||||
"""
|
||||
d0 = self.options.get_config("controlnetif0")
|
||||
if d0:
|
||||
logging.error("controlnet0 cannot be assigned with a host interface")
|
||||
|
@ -1661,7 +1661,7 @@ class Session:
|
|||
|
||||
:param dev: device to get control net index for
|
||||
:return: control net index, -1 otherwise
|
||||
"""
|
||||
"""
|
||||
if dev[0:4] == "ctrl" and int(dev[4]) in [0, 1, 2, 3]:
|
||||
index = int(dev[4])
|
||||
if index == 0:
|
||||
|
@ -1696,7 +1696,7 @@ class Session:
|
|||
:param remove: flag to check if it should be removed
|
||||
:param conf_required: flag to check if conf is required
|
||||
:return: control net node
|
||||
"""
|
||||
"""
|
||||
logging.debug(
|
||||
"add/remove control net: index(%s) remove(%s) conf_required(%s)",
|
||||
net_index,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue