[X2Go-Commits] [x2gobroker] 01/02: obligatory profile keys: Move from inifile backend to UCCS frontend, as those requirements are frontend specific.
git-admin at x2go.org
git-admin at x2go.org
Thu May 3 12:49:09 CEST 2018
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch master
in repository x2gobroker.
commit 914579d4db5d7c4a1e71f46adb579c7ee5c6c623
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date: Thu May 3 12:44:17 2018 +0200
obligatory profile keys: Move from inifile backend to UCCS frontend, as those requirements are frontend specific.
---
x2gobroker/brokers/inifile_broker.py | 12 ------------
x2gobroker/web/uccs.py | 11 +++++++++++
2 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/x2gobroker/brokers/inifile_broker.py b/x2gobroker/brokers/inifile_broker.py
index 4c5a15d..0f0894d 100644
--- a/x2gobroker/brokers/inifile_broker.py
+++ b/x2gobroker/brokers/inifile_broker.py
@@ -78,18 +78,6 @@ class X2GoBroker(base.X2GoBroker):
if key not in list(profile.keys()):
profile.update({ key: profile_defaults[key] })
- # obligatory profile keys:
-
- if 'host' not in profile:
- raise x2gobroker.x2gobroker_exceptions.X2GoBrokerProfileException('Session profile ID \'{profile_id}\' lacks \'host\' key; profile is unusable'.format(profile_id=profile_id))
-
- if 'name' not in profile:
- profile['name'] = profile_id
-
- if not ('directrdp' in profile and profile['directrdp']):
- if 'sshport' not in profile:
- profile['sshport'] = 22
-
for key in list(profile.keys()):
if key.startswith('acl-'):
del profile[key]
diff --git a/x2gobroker/web/uccs.py b/x2gobroker/web/uccs.py
index 0ce80b3..8985681 100644
--- a/x2gobroker/web/uccs.py
+++ b/x2gobroker/web/uccs.py
@@ -160,6 +160,17 @@ class X2GoBrokerWebAPI(tornado.web.RequestHandler):
)
ts.set_domain('LOCAL')
else:
+
+ # obligatory profile keys:
+ if 'host' not in profile:
+ raise x2gobroker.x2gobroker_exceptions.X2GoBrokerProfileException('Session profile ID \'{profile_id}\' lacks \'host\' key; profile is unusable'.format(profile_id=profile_id))
+
+ if 'name' not in profile:
+ profile['name'] = profile_id
+
+ if 'sshport' not in profile:
+ profile['sshport'] = 22
+
_hostname = random.choice(hosts)
_port = profile['sshport']
if 'sshport={hostname}'.format(hostname=_hostname) in profile:
--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2gobroker.git
More information about the x2go-commits
mailing list