Some cleaning.

This commit is contained in:
grossmj committed 2021-04-17 18:36:32 +09:30
1 parent bad3ef7003
commit 44074ff7c9
22 files changed
+122 -99

No files matched your search

@@ -40,7 +40,12 @@ class EthernetHub(BaseNode):
def __json__(self):
return {"name": self.name, "usage": self.usage, "node_id": self.id, "project_id": self.project.id}
return {
"name": self.name,
"usage": self.usage,
"node_id": self.id,
"project_id": self.project.id
}
async def create(self):
"""
@@ -40,7 +40,12 @@ class EthernetSwitch(BaseNode):
def __json__(self):
return {"name": self.name, "usage": self.usage, "node_id": self.id, "project_id": self.project.id}
return {
"name": self.name,
"usage": self.usage,
"node_id": self.id,
"project_id": self.project.id
}
async def create(self):
"""
@@ -67,4 +67,7 @@ class NIOGenericEthernet(NIO):
def __json__(self):
return {"type": "nio_generic_ethernet", "ethernet_device": self._ethernet_device}
return {
"type": "nio_generic_ethernet",
"ethernet_device": self._ethernet_device
}
@@ -66,4 +66,7 @@ class NIOLinuxEthernet(NIO):
def __json__(self):
return {"type": "nio_linux_ethernet", "ethernet_device": self._ethernet_device}
return {
"type": "nio_linux_ethernet",
"ethernet_device": self._ethernet_device
}
+4 -1
View File
@@ -60,4 +60,7 @@ class NIOTAP(NIO):
def __json__(self):
return {"type": "nio_tap", "tap_device": self._tap_device}
return {
"type": "nio_tap",
"tap_device": self._tap_device
}
+6 -1
View File
@@ -128,4 +128,9 @@ class NIOUDP(NIO):
def __json__(self):
return {"type": "nio_udp", "lport": self._lport, "rport": self._rport, "rhost": self._rhost}
return {
"type": "nio_udp",
"lport": self._lport,
"rport": self._rport,
"rhost": self._rhost
}
+5 -1
View File
@@ -81,4 +81,8 @@ class NIOUNIX(NIO):
def __json__(self):
return {"type": "nio_unix", "local_file": self._local_file, "remote_file": self._remote_file}
return {
"type": "nio_unix",
"local_file": self._local_file,
"remote_file": self._remote_file
}
+5 -1
View File
@@ -81,4 +81,8 @@ class NIOVDE(NIO):
def __json__(self):
return {"type": "nio_vde", "local_file": self._local_file, "control_file": self._control_file}
return {
"type": "nio_vde",
"local_file": self._local_file,
"control_file": self._control_file
}
+4 -1
View File
@@ -50,4 +50,7 @@ class NIOEthernet(NIO):
def __json__(self):
return {"type": "nio_ethernet", "ethernet_device": self._ethernet_device}
return {
"type": "nio_ethernet",
"ethernet_device": self._ethernet_device
}
+4 -1
View File
@@ -50,4 +50,7 @@ class NIOTAP(NIO):
def __json__(self):
return {"type": "nio_tap", "tap_device": self._tap_device}
return {
"type": "nio_tap",
"tap_device": self._tap_device
}
+6 -1
View File
@@ -74,4 +74,9 @@ class NIOUDP(NIO):
def __json__(self):
return {"type": "nio_udp", "lport": self._lport, "rport": self._rport, "rhost": self._rhost}
return {
"type": "nio_udp",
"lport": self._lport,
"rport": self._rport,
"rhost": self._rhost
}
+5 -1
View File
@@ -79,7 +79,11 @@ class Project:
def __json__(self):
return {"name": self._name, "project_id": self._id, "variables": self._variables}
return {
"name": self._name,
"project_id": self._id,
"variables": self._variables
}
def is_local(self):