1
0
mirror of https://github.com/dkmstr/openuds.git synced 2024-12-23 17:34:17 +03:00

Fixed small actor network card check and removed required of network for interface select

This commit is contained in:
Adolfo Gómez García 2022-06-20 19:42:36 +02:00
parent 972c48ddee
commit f43b9c7bfd
2 changed files with 19 additions and 16 deletions

View File

@ -124,6 +124,7 @@ class UDSConfigDialog(QDialog):
def saveConfig(self) -> None:
# Ensure restrict_net is empty or a valid subnet
restrictNet = self.ui.restrictNet.text().strip()
if restrictNet:
try:
subnet = udsactor.tools.strToNoIPV4Network(restrictNet)
if not subnet:
@ -163,9 +164,9 @@ if __name__ == "__main__":
app = QApplication(sys.argv)
#if udsactor.platform.operations.checkPermissions() is False:
# QMessageBox.critical(None, 'UDS Actor', 'This Program must be executed as administrator', QMessageBox.Ok) # type: ignore
# sys.exit(1)
if udsactor.platform.operations.checkPermissions() is False:
QMessageBox.critical(None, 'UDS Actor', 'This Program must be executed as administrator', QMessageBox.Ok) # type: ignore
sys.exit(1)
if len(sys.argv) > 2:
if sys.argv[1] == 'export':

View File

@ -397,7 +397,9 @@ class CommonService: # pylint: disable=too-many-instance-attributes
):
# Not enouth data do check
return
currentInterfaces = list(platform.operations.getNetworkInfo())
currentInterfaces = tools.validNetworkCards(
self._cfg.restrict_net, platform.operations.getNetworkInfo()
)
old = self.serviceInterfaceInfo()
new = self.serviceInterfaceInfo(currentInterfaces)
if not new or not old: