1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-12 19:38:57 +00:00

Explicitly import handlers so freezing application can find and include the right modules.

Do not import IOU on Windows to avoid importing unknown modules like fcntl on that platform.
This commit is contained in:
Jeremy 2015-02-26 19:31:18 -07:00
parent 58d92f1584
commit 985c23a40e
4 changed files with 21 additions and 14 deletions

View File

@ -14,5 +14,16 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from gns3server.handlers.api import *
import sys
from gns3server.handlers.api.version_handler import VersionHandler
from gns3server.handlers.api.network_handler import NetworkHandler
from gns3server.handlers.api.project_handler import ProjectHandler
from gns3server.handlers.api.dynamips_device_handler import DynamipsDeviceHandler
from gns3server.handlers.api.dynamips_vm_handler import DynamipsVMHandler
from gns3server.handlers.api.qemu_handler import QEMUHandler
from gns3server.handlers.api.virtualbox_handler import VirtualBoxHandler
from gns3server.handlers.api.vpcs_handler import VPCSHandler
from gns3server.handlers.upload_handler import UploadHandler
if sys.platform.startswith("linux"):
from gns3server.handlers.api.iou_handler import IOUHandler

View File

@ -1,9 +0,0 @@
__all__ = ["version_handler",
"network_handler",
"vpcs_handler",
"project_handler",
"virtualbox_handler",
"dynamips_vm_handler",
"dynamips_device_handler",
"iou_handler",
"qemu_handler"]

View File

@ -15,10 +15,15 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys
from .vpcs import VPCS
from .virtualbox import VirtualBox
from .dynamips import Dynamips
from .iou import IOU
from .qemu import Qemu
MODULES = [VPCS, VirtualBox, Dynamips, IOU, Qemu]
MODULES = [VPCS, VirtualBox, Dynamips, Qemu]
if sys.platform.startswith("linux"):
# IOU runs only on Linux
from .iou import IOU
MODULES.append(IOU)

View File

@ -34,8 +34,8 @@ from .config import Config
from .modules import MODULES
from .modules.port_manager import PortManager
# TODO: get rid of * have something generic to automatically import handlers so the routes can be found
from gns3server.handlers import *
# do not delete this import
import gns3server.handlers
import logging
log = logging.getLogger(__name__)