summaryrefslogtreecommitdiff
path: root/src/leap/services
diff options
context:
space:
mode:
authorkali <kali@leap.se>2013-03-14 07:08:31 +0900
committerkali <kali@leap.se>2013-03-15 01:02:11 +0900
commitd0dfad6ac2af360de6421ce74a6831b5b81ad019 (patch)
treea0a79d4fb328e09ab85f53d826d65f5d7f874f0c /src/leap/services
parentb76461efe13d24950cb389735432024c26e1e768 (diff)
namespace leap + leap.common split
leap is a namespace package from here on. common folder will be deleted and moved to leap_pycommon repository.
Diffstat (limited to 'src/leap/services')
-rw-r--r--src/leap/services/eip/eipbootstrapper.py11
-rw-r--r--src/leap/services/eip/eipconfig.py2
-rw-r--r--src/leap/services/eip/providerbootstrapper.py10
-rw-r--r--src/leap/services/eip/vpn.py2
-rw-r--r--src/leap/services/eip/vpnlaunchers.py51
5 files changed, 18 insertions, 58 deletions
diff --git a/src/leap/services/eip/eipbootstrapper.py b/src/leap/services/eip/eipbootstrapper.py
index c83cb1b5..19b74856 100644
--- a/src/leap/services/eip/eipbootstrapper.py
+++ b/src/leap/services/eip/eipbootstrapper.py
@@ -19,20 +19,21 @@
EIP bootstrapping
"""
-import requests
import logging
import os
+import requests
+
from PySide import QtGui, QtCore
-from leap.crypto.srpauth import SRPAuth
+from leap.common.check import leap_assert, leap_assert_type
+from leap.common.certs import is_valid_pemfile, should_redownload
+from leap.common.files import check_and_fix_urw_only, get_mtime, mkdir_p
from leap.config.providerconfig import ProviderConfig
+from leap.crypto.srpauth import SRPAuth
from leap.services.eip.eipconfig import EIPConfig
-from leap.util.check import leap_assert, leap_assert_type
from leap.util.checkerthread import CheckerThread
-from leap.util.files import check_and_fix_urw_only, get_mtime, mkdir_p
from leap.util.request_helpers import get_content
-from leap.util.certs import is_valid_pemfile, should_redownload
logger = logging.getLogger(__name__)
diff --git a/src/leap/services/eip/eipconfig.py b/src/leap/services/eip/eipconfig.py
index eab5bfd4..3f873878 100644
--- a/src/leap/services/eip/eipconfig.py
+++ b/src/leap/services/eip/eipconfig.py
@@ -21,10 +21,10 @@ Provider configuration
import os
import logging
+from leap.common.check import leap_assert, leap_assert_type
from leap.config.baseconfig import BaseConfig
from leap.config.providerconfig import ProviderConfig
from leap.services.eip.eipspec import eipservice_config_spec
-from leap.util.check import leap_assert, leap_assert_type
logger = logging.getLogger(__name__)
diff --git a/src/leap/services/eip/providerbootstrapper.py b/src/leap/services/eip/providerbootstrapper.py
index 40ec55c5..778d5149 100644
--- a/src/leap/services/eip/providerbootstrapper.py
+++ b/src/leap/services/eip/providerbootstrapper.py
@@ -18,20 +18,20 @@
"""
Provider bootstrapping
"""
-
-import requests
import logging
import socket
import os
+import requests
+
from PySide import QtGui, QtCore
+from leap.common.certs import get_digest
+from leap.common.files import check_and_fix_urw_only, get_mtime, mkdir_p
+from leap.common.check import leap_assert, leap_assert_type
from leap.config.providerconfig import ProviderConfig
-from leap.util.check import leap_assert, leap_assert_type
from leap.util.checkerthread import CheckerThread
-from leap.util.files import check_and_fix_urw_only, get_mtime, mkdir_p
from leap.util.request_helpers import get_content
-from leap.util.certs import get_digest
logger = logging.getLogger(__name__)
diff --git a/src/leap/services/eip/vpn.py b/src/leap/services/eip/vpn.py
index dd42cd13..66b39dd9 100644
--- a/src/leap/services/eip/vpn.py
+++ b/src/leap/services/eip/vpn.py
@@ -26,11 +26,11 @@ import psutil
from PySide import QtCore, QtGui
from functools import partial
+from leap.common.check import leap_assert, leap_assert_type
from leap.config.providerconfig import ProviderConfig
from leap.services.eip.vpnlaunchers import get_platform_launcher
from leap.services.eip.eipconfig import EIPConfig
from leap.services.eip.udstelnet import UDSTelnet
-from leap.util.check import leap_assert, leap_assert_type
logger = logging.getLogger(__name__)
diff --git a/src/leap/services/eip/vpnlaunchers.py b/src/leap/services/eip/vpnlaunchers.py
index c646da7d..f9e8e366 100644
--- a/src/leap/services/eip/vpnlaunchers.py
+++ b/src/leap/services/eip/vpnlaunchers.py
@@ -18,18 +18,19 @@
"""
Platform dependant VPN launchers
"""
-import os
-import platform
-import logging
import commands
+import logging
import getpass
import grp
+import os
+import platform
from abc import ABCMeta, abstractmethod
+from leap.common.check import leap_assert, leap_assert_type
+from leap.common.files import which
from leap.config.providerconfig import ProviderConfig
from leap.services.eip.eipconfig import EIPConfig
-from leap.util.check import leap_assert, leap_assert_type
logger = logging.getLogger(__name__)
@@ -86,48 +87,6 @@ def get_platform_launcher():
return launcher()
-# Twisted implementation of which
-def which(name, flags=os.X_OK, path_extension="/usr/sbin:/sbin"):
- """
- Search PATH for executable files with the given name.
-
- On newer versions of MS-Windows, the PATHEXT environment variable will be
- set to the list of file extensions for files considered executable. This
- will normally include things like ".EXE". This fuction will also find files
- with the given name ending with any of these extensions.
-
- On MS-Windows the only flag that has any meaning is os.F_OK. Any other
- flags will be ignored.
-
- @type name: C{str}
- @param name: The name for which to search.
-
- @type flags: C{int}
- @param flags: Arguments to L{os.access}.
-
- @rtype: C{list}
- @param: A list of the full paths to files found, in the
- order in which they were found.
- """
-
- result = []
- exts = filter(None, os.environ.get('PATHEXT', '').split(os.pathsep))
- path = os.environ.get('PATH', None)
- path += ":" + path_extension
- if path is None:
- return []
- parts = path.split(os.pathsep)
- for p in parts:
- p = os.path.join(p, name)
- if os.access(p, flags):
- result.append(p)
- for e in exts:
- pext = p + e
- if os.access(pext, flags):
- result.append(pext)
- return result
-
-
def _is_pkexec_in_system():
pkexec_path = which('pkexec')
if len(pkexec_path) == 0: