[X2Go-Commits] x2gobroker.git - master (branch) updated: 0.0.2.3-39-g9a830df
X2Go dev team
git-admin at x2go.org
Wed Oct 2 08:40:33 CEST 2013
The branch, master has been updated
via 9a830df0f3147d0d85b682bf87c49eb949bbf364 (commit)
from 470d10d15b4783be8f46a480527afa11ea05a89f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 9a830df0f3147d0d85b682bf87c49eb949bbf364
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date: Wed Oct 2 08:40:23 2013 +0200
Provide a test function that checks if the basic broker agent setup (SSH private/public key pair) is available. If not, no SSH broker usage will be attempted.
-----------------------------------------------------------------------
Summary of changes:
debian/changelog | 3 +++
x2gobroker/agent.py | 18 ++++++++++++++++++
x2gobroker/brokers/base_broker.py | 2 +-
3 files changed, 22 insertions(+), 1 deletion(-)
The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 780dc54..6d392a6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -25,6 +25,9 @@ x2gobroker (0.0.3.0-0~x2go1) UNRELEASED; urgency=low
- Fix Python2'isms in three exceptions. Thanks to Mathias Ewald for
spotting.
- Make test_suite callable via setup.py.
+ - Provide a test function that checks if the basic broker agent setup
+ (SSH private/public key pair) is available. If not, no SSH broker
+ usage will be attempted.
* /debian/control:
+ Replace LDAP support with session brokerage support in LONG_DESCRIPTION.
* /debian/x2gobroker-agent.dirs:
diff --git a/x2gobroker/agent.py b/x2gobroker/agent.py
index 639afd3..7ae1520 100644
--- a/x2gobroker/agent.py
+++ b/x2gobroker/agent.py
@@ -19,6 +19,7 @@
# Free Software Foundation, Inc.,
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+import os.path
import subprocess
import paramiko
import cStringIO
@@ -53,6 +54,23 @@ class delayed_execution(threading.Thread):
self.agent_func(**self.kwargs)
+def has_remote_broker_agent_setup():
+ """\
+ Peform some integrity checks that may indicate that a remote
+ broker agent setup is available.
+
+ - Check for available SSH private keys.
+ - Nothing else, so far...
+
+ """
+ home = os.path.expanduser("~")
+ if os.path.exists(os.path.join(home, '.ssh', 'id_rsa')
+ return True
+ elsif os.path.exists(os.path.join(home, '.ssh', 'id_dsa')
+ return True
+ elsif os.path.exists(os.path.join(home, '.ssh', 'id_ecdsa')
+ return True
+
def call_local_broker_agent(username, mode, cmdline_args=[]):
"""\
Launch X2Go Broker Agent locally and process its output.
diff --git a/x2gobroker/brokers/base_broker.py b/x2gobroker/brokers/base_broker.py
index 7d39f43..6196f4d 100644
--- a/x2gobroker/brokers/base_broker.py
+++ b/x2gobroker/brokers/base_broker.py
@@ -810,7 +810,7 @@ class X2GoBroker(object):
remote_agent = None
agent_query_mode = self.get_agent_query_mode(profile_id).upper()
- if agent_query_mode == u'SSH':
+ if agent_query_mode == u'SSH' and x2gobroker.agent.has_remote_broker_agent_setup():
profile = self.get_profile(profile_id)
server_list = profile[u'host']
hooks/post-receive
--
x2gobroker.git (HTTP(S) Session broker for X2Go)
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "x2gobroker.git" (HTTP(S) Session broker for X2Go).
More information about the x2go-commits
mailing list