Skip to content

Commit

Permalink
Chain import exceptions for tools.restricted.EnableXmlCli and tools.E…
Browse files Browse the repository at this point in the history
…nableXmlCli
  • Loading branch information
laalvare authored and gahan9 committed Sep 10, 2024
1 parent 2a01b73 commit 02a2fd1
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/xmlcli/XmlCliLib.py
Original file line number Diff line number Diff line change
Expand Up @@ -792,12 +792,13 @@ def ConfXmlCli(SkipEnable=0):
try:
from .tools.restricted import EnableXmlCli as exc
except (ModuleNotFoundError, ImportError) as e:
from .tools import EnableXmlCli as exc
except ImportError:
log.error(f'Import error on EnableXmlCli, current Python version {sys.version}')
CloseInterface()
LastErrorSig = 0x13E4 # import error
return 0xF
try:
from .tools import EnableXmlCli as exc
except ImportError:
log.error(f'Import error on EnableXmlCli, current Python version {sys.version}')
CloseInterface()
LastErrorSig = 0x13E4 # import error
return 0xF
Status = exc.EnableXmlCli()
if Status == 0:
Status = 2
Expand All @@ -824,11 +825,12 @@ def TriggerXmlCliEntry():
try:
from .tools.restricted import EnableXmlCli as exc
except (ModuleNotFoundError, ImportError) as e:
from .tools import EnableXmlCli as exc
except ImportError:
log.error(f'Import error on EnableXmlCli, current Python version {sys.version}')
LastErrorSig = 0x13E4 # import error
return 1
try:
from .tools import EnableXmlCli as exc
except ImportError:
log.error(f'Import error on EnableXmlCli, current Python version {sys.version}')
LastErrorSig = 0x13E4 # import error
return 1
status = exc.XmlCliApiAuthenticate()
if status:
LastErrorSig = 0xE7CA # Error Triggering XmlCli command, Authentication Failed
Expand Down

0 comments on commit 02a2fd1

Please sign in to comment.