mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-26 18:38:41 -06:00
[ADD] protect paramiko imports
This commit is contained in:
parent
790c568b86
commit
abe12f6522
@ -1,7 +1,10 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# © 2016 Therp BV <http://therp.nl>
|
# © 2016 Therp BV <http://therp.nl>
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
|
try:
|
||||||
from paramiko import SFTP_EOF, SFTPHandle
|
from paramiko import SFTP_EOF, SFTPHandle
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
from base64 import b64decode
|
from base64 import b64decode
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,10 +1,13 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# © 2016 Therp BV <http://therp.nl>
|
# © 2016 Therp BV <http://therp.nl>
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
|
try:
|
||||||
from paramiko import AUTH_SUCCESSFUL, AUTH_FAILED,\
|
from paramiko import AUTH_SUCCESSFUL, AUTH_FAILED,\
|
||||||
OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED, OPEN_SUCCEEDED,\
|
OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED, OPEN_SUCCEEDED,\
|
||||||
RSAKey, ServerInterface
|
RSAKey, ServerInterface
|
||||||
from paramiko.py3compat import decodebytes
|
from paramiko.py3compat import decodebytes
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
from openerp.exceptions import AccessDenied
|
from openerp.exceptions import AccessDenied
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# © 2016 Therp BV <http://therp.nl>
|
# © 2016 Therp BV <http://therp.nl>
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
|
try:
|
||||||
from paramiko import Transport
|
from paramiko import Transport
|
||||||
from paramiko.transport import DEFAULT_WINDOW_SIZE, DEFAULT_MAX_PACKET_SIZE
|
from paramiko.transport import DEFAULT_WINDOW_SIZE, DEFAULT_MAX_PACKET_SIZE
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
from openerp import api, SUPERUSER_ID
|
from openerp import api, SUPERUSER_ID
|
||||||
from openerp.modules.registry import RegistryManager
|
from openerp.modules.registry import RegistryManager
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user