summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/services/__init__.py
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2013-09-19 15:50:43 -0400
committerKali Kaneko <kali@leap.se>2013-09-19 15:50:43 -0400
commit1c194fe4b5d7b43097c31331cc8a7162bfbef4be (patch)
treedd2f1e7901993208a00055e1f31595849d41eb51 /src/leap/bitmask/services/__init__.py
parent006f362af526e9283c698805100e54c18b2be390 (diff)
parent6cd19c3b67d76268bab5f93d3168164ec02f603d (diff)
Merge remote-tracking branch 'ivan-github/feature/standalone-flag-to-module' into develop
Diffstat (limited to 'src/leap/bitmask/services/__init__.py')
-rw-r--r--src/leap/bitmask/services/__init__.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/leap/bitmask/services/__init__.py b/src/leap/bitmask/services/__init__.py
index 2646235d..afce72f6 100644
--- a/src/leap/bitmask/services/__init__.py
+++ b/src/leap/bitmask/services/__init__.py
@@ -22,10 +22,12 @@ import os
from PySide import QtCore
+from leap.bitmask.config import flags
from leap.bitmask.crypto.srpauth import SRPAuth
from leap.bitmask.util.constants import REQUEST_TIMEOUT
from leap.bitmask.util.privilege_policies import is_missing_policy_permissions
from leap.bitmask.util.request_helpers import get_content
+from leap.bitmask.util import get_path_prefix
from leap.common.check import leap_assert
from leap.common.config.baseconfig import BaseConfig
@@ -37,7 +39,7 @@ logger = logging.getLogger(__name__)
DEPLOYED = ["openvpn", "mx"]
-def get_service_display_name(service, standalone=False):
+def get_service_display_name(service):
"""
Returns the name to display of the given service.
If there is no configured name for that service, then returns the same
@@ -45,9 +47,6 @@ def get_service_display_name(service, standalone=False):
:param service: the 'machine' service name
:type service: str
- :param standalone: True if the app is running in a standalone mode, used
- to display messages according that.
- :type standalone: bool
:rtype: str
"""
@@ -67,7 +66,7 @@ def get_service_display_name(service, standalone=False):
# administrative permissions to start. That can be either
# because we are running in standalone mode, or because we could
# not find the needed privilege escalation mechanisms being operative.
- if standalone or is_missing_policy_permissions():
+ if flags.STANDALONE or is_missing_policy_permissions():
EIP_LABEL += " " + _tr("(will need admin password to start)")
return service_display.get(service, service)
@@ -106,9 +105,8 @@ def download_service_config(provider_config, service_config,
service_name = service_config.name
service_json = "{0}-service.json".format(service_name)
headers = {}
- mtime = get_mtime(os.path.join(service_config.get_path_prefix(),
- "leap",
- "providers",
+ mtime = get_mtime(os.path.join(get_path_prefix(),
+ "leap", "providers",
provider_config.get_domain(),
service_json))
if download_if_needed and mtime: