Merge branch 'develop' into coretk-fix
This commit is contained in:
commit
8bcacf0a04
8 changed files with 15 additions and 11 deletions
|
@ -54,7 +54,7 @@ class DistributedServer:
|
|||
user's home directory
|
||||
:param wait: True to wait for status, False to background process
|
||||
:return: stdout when success
|
||||
:raises CoreCommandError: when a non-zero exit status occurs
|
||||
:raises CoreCommandError: when a non-zero exit status occurs
|
||||
"""
|
||||
|
||||
replace_env = env is not None
|
||||
|
|
|
@ -181,7 +181,7 @@ class Session:
|
|||
|
||||
:param _class: node class to get a node type for
|
||||
:return: node type
|
||||
:raises CoreError: when node type does not exist
|
||||
:raises CoreError: when node type does not exist
|
||||
"""
|
||||
node_type = NODES_TYPE.get(_class)
|
||||
if node_type is None:
|
||||
|
@ -749,7 +749,7 @@ class Session:
|
|||
:param node_id: id of node to update
|
||||
:param options: data to update node with
|
||||
:return: True if node updated, False otherwise
|
||||
:raises core.CoreError: when node to update does not exist
|
||||
:raises core.CoreError: when node to update does not exist
|
||||
"""
|
||||
# get node to update
|
||||
node = self.get_node(node_id)
|
||||
|
@ -1362,7 +1362,7 @@ class Session:
|
|||
|
||||
:param _id: node id to retrieve
|
||||
:return: node for the given id
|
||||
:raises core.CoreError: when node does not exist
|
||||
:raises core.CoreError: when node does not exist
|
||||
"""
|
||||
if _id not in self.nodes:
|
||||
raise CoreError(f"unknown node id {_id}")
|
||||
|
|
|
@ -108,7 +108,7 @@ class NodeBase:
|
|||
:param wait: True to wait for status, False otherwise
|
||||
:param shell: True to use shell, False otherwise
|
||||
:return: combined stdout and stderr
|
||||
:raises CoreCommandError: when a non-zero exit status occurs
|
||||
:raises CoreCommandError: when a non-zero exit status occurs
|
||||
"""
|
||||
if self.server is None:
|
||||
return utils.cmd(args, env, cwd, wait, shell)
|
||||
|
@ -410,7 +410,7 @@ class CoreNodeBase(NodeBase):
|
|||
:param wait: True to wait for status, False otherwise
|
||||
:param shell: True to use shell, False otherwise
|
||||
:return: combined stdout and stderr
|
||||
:raises CoreCommandError: when a non-zero exit status occurs
|
||||
:raises CoreCommandError: when a non-zero exit status occurs
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
|
@ -591,7 +591,7 @@ class CoreNode(CoreNodeBase):
|
|||
:param wait: True to wait for status, False otherwise
|
||||
:param shell: True to use shell, False otherwise
|
||||
:return: combined stdout and stderr
|
||||
:raises CoreCommandError: when a non-zero exit status occurs
|
||||
:raises CoreCommandError: when a non-zero exit status occurs
|
||||
"""
|
||||
if self.server is None:
|
||||
return self.client.check_cmd(args, wait=wait, shell=shell)
|
||||
|
|
|
@ -60,7 +60,7 @@ class VnodeClient:
|
|||
:param wait: True to wait for command status, False otherwise
|
||||
:param shell: True to use shell, False otherwise
|
||||
:return: combined stdout and stderr
|
||||
:raises core.CoreCommandError: when there is a non-zero exit status
|
||||
:raises core.CoreCommandError: when there is a non-zero exit status
|
||||
"""
|
||||
self._verify_connection()
|
||||
args = self.create_cmd(args)
|
||||
|
|
|
@ -80,7 +80,7 @@ class CoreInterface:
|
|||
:param wait: True to wait for status, False otherwise
|
||||
:param shell: True to use shell, False otherwise
|
||||
:return: combined stdout and stderr
|
||||
:raises CoreCommandError: when a non-zero exit status occurs
|
||||
:raises CoreCommandError: when a non-zero exit status occurs
|
||||
"""
|
||||
if self.server is None:
|
||||
return utils.cmd(args, env, cwd, wait, shell)
|
||||
|
|
|
@ -309,7 +309,7 @@ class CoreNetwork(CoreNetworkBase):
|
|||
:param wait: True to wait for status, False otherwise
|
||||
:param shell: True to use shell, False otherwise
|
||||
:return: combined stdout and stderr
|
||||
:raises CoreCommandError: when a non-zero exit status occurs
|
||||
:raises CoreCommandError: when a non-zero exit status occurs
|
||||
"""
|
||||
logging.debug("network node(%s) cmd", self.name)
|
||||
output = utils.cmd(args, env, cwd, wait, shell)
|
||||
|
|
|
@ -373,7 +373,7 @@ class Rj45Node(CoreNodeBase, CoreInterface):
|
|||
:param ifindex: interface index
|
||||
:param ifname: interface name
|
||||
:return: interface index
|
||||
:raises ValueError: when an interface has already been created, one max
|
||||
:raises ValueError: when an interface has already been created, one max
|
||||
"""
|
||||
with self.lock:
|
||||
if ifindex is None:
|
||||
|
|
|
@ -762,7 +762,9 @@ class CoreXmlReader:
|
|||
node_id = get_int(device_element, "id")
|
||||
name = device_element.get("name")
|
||||
model = device_element.get("type")
|
||||
icon = device_element.get("icon")
|
||||
options = NodeOptions(name, model)
|
||||
options.icon = icon
|
||||
|
||||
service_elements = device_element.find("services")
|
||||
if service_elements is not None:
|
||||
|
@ -788,7 +790,9 @@ class CoreXmlReader:
|
|||
node_id = get_int(network_element, "id")
|
||||
name = network_element.get("name")
|
||||
node_type = NodeTypes[network_element.get("type")]
|
||||
icon = network_element.get("icon")
|
||||
options = NodeOptions(name)
|
||||
options.icon = icon
|
||||
|
||||
position_element = network_element.find("position")
|
||||
if position_element is not None:
|
||||
|
|
Loading…
Reference in a new issue