[X2Go-Commits] x2gobroker.git - master (branch) updated: 0.0.2.1-3-g44fb5f4

X2Go dev team git-admin at x2go.org
Sun May 19 14:31:08 CEST 2013


The branch, master has been updated
       via  44fb5f47579b3b2cde8093ce8c05b46e11a13e67 (commit)
      from  ff5d005efbaabf23d034af46fae4310445f173c1 (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 44fb5f47579b3b2cde8093ce8c05b46e11a13e67
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Sun May 19 14:30:49 2013 +0200

    Convert unicode type host fields into single element lists. Fix UCCS+zeroconf tests.

-----------------------------------------------------------------------

Summary of changes:
 debian/changelog                           |    4 +++-
 x2gobroker/tests/test_broker_inifile.py    |    1 -
 x2gobroker/tests/test_web_uccs_zeroconf.py |   24 ++++++++++++++++++++----
 x2gobroker/web/uccs.py                     |    9 +++++++--
 4 files changed, 30 insertions(+), 8 deletions(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 353fe2f..0749ee7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,8 @@
 x2gobroker (0.0.2.2-0~x2go1) UNRELEASED; urgency=low
 
-  * Continue development...
+  * New upstream version (0.0.2.2):
+    - Convert unicode type host fields into single element lists. Fix
+      UCCS+zeroconf tests.
 
  -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Sun, 19 May 2013 13:12:51 +0200
 
diff --git a/x2gobroker/tests/test_broker_inifile.py b/x2gobroker/tests/test_broker_inifile.py
index 1e99f7a..b7181a4 100644
--- a/x2gobroker/tests/test_broker_inifile.py
+++ b/x2gobroker/tests/test_broker_inifile.py
@@ -86,7 +86,6 @@ command = GNOME
         } )
         _expected_profile = copy.deepcopy(_expected_defaults)
         _profile = inifile_backend.get_profile('testprofile')
-        print _expected_defaults
         for key in _expected_profile.keys():
             self.assertTrue( ( key in _profile.keys() ) )
         for key in _profile.keys():
diff --git a/x2gobroker/tests/test_web_uccs_zeroconf.py b/x2gobroker/tests/test_web_uccs_zeroconf.py
index b796fb5..d02a1a5 100644
--- a/x2gobroker/tests/test_web_uccs_zeroconf.py
+++ b/x2gobroker/tests/test_web_uccs_zeroconf.py
@@ -23,12 +23,16 @@ from paste.fixture import TestApp
 from nose.tools import *
 import tornado.wsgi
 import json
+import base64
 
 # Python X2GoBroker modules
 import x2gobroker.defaults
 import x2gobroker.web.uccs
 
-urls = ( ('/uccs/(.*)', x2gobroker.web.uccs.X2GoBrokerWeb,) ,)
+urls = (
+         ('/uccs/[a-zA-Z]*(/*)$', x2gobroker.web.uccs.X2GoBrokerWeb,),
+         ('/uccs/(.*)/api/([0-9])(/*)$', x2gobroker.web.uccs.X2GoBrokerWebAPI,),
+)
 application = tornado.wsgi.WSGIApplication(urls)
 
 class TestX2GoBrokerWebUccsZeroConf(unittest.TestCase):
@@ -40,20 +44,24 @@ class TestX2GoBrokerWebUccsZeroConf(unittest.TestCase):
             u'URL': u'http://localhost:8080/uccs/zeroconf',
             u'AdditionalManagementServers': [],
             u'Name': u'X2Go Session Broker',
+            u'DefaultServer': u'LOCALHOST',
             u'RemoteDesktopServers': [
                 {
                     u'Username': u'',
                     u'Protocol': u'x2go',
                     u'Name': u'LOCALHOST',
-                    u'URL': u'localhost:22',
+                    u'URL': u'http://localhost:22/',
+                    u'SessionType': u'KDE',
                     u'SessionTypeRequired': True,
-                    u'Password': None
+                    u'Password': u'',
                 },
             ],
+            u'URL': u'http://localhost:8080/uccs/zeroconf/',
         }
         _config = """
 [global]
 enable-uccs-output=true
+check-credentials=false
 
 [zeroconf]
 enable = true
@@ -65,7 +73,15 @@ desktop-shell = KDE
         tf.seek(0)
         x2gobroker.defaults.X2GOBROKER_CONFIG = tf.name
         testApp = TestApp(application)
-        r = testApp.get('/uccs/zeroconf/', params={'user': 'test', 'password': 'sweet',  'task': 'listsessions', }, expect_errors=True)
+
+        #username = 'test'
+        #password = 'sweet'
+        #base64String = base64.encodestring('{username}:{password}'.format(username=username, password=password))[:-1]
+        #authHeader =  "Basic {authcred}".format(authcred=base64String)
+        #headers = {'Authorization': authHeader}
+        headers = {}
+
+        r = testApp.get('/uccs/zeroconf/api/4', headers=headers, expect_errors=True)
         assert_equal(r.status, 200)
         body = r.normal_body
         result = json.loads(body)
diff --git a/x2gobroker/web/uccs.py b/x2gobroker/web/uccs.py
index 8422664..e518640 100644
--- a/x2gobroker/web/uccs.py
+++ b/x2gobroker/web/uccs.py
@@ -24,6 +24,7 @@
 import re
 import base64
 import datetime
+import types
 import tornado.web
 
 # Python X2Go Broker modules
@@ -142,16 +143,20 @@ class X2GoBrokerWebAPI(tornado.web.RequestHandler):
 
         for profile_id in profile_ids:
 
+            hosts = profiles[profile_id][u'host']
+            if type(hosts) == types.UnicodeType:
+                hosts = [hosts]
+
             if profiles[profile_id][u'directrdp']:
                 ts = x2gobroker.uccsjson.RDPServer(
-                        host='{hostname}'.format(hostname=profiles[profile_id][u'host'][0]),
+                        host='{hostname}'.format(hostname=hosts[0]),
                         name=profiles[profile_id][u'name'],
                         username=profiles[profile_id][u'user'],
                 )
                 ts.set_domain('LOCAL')
             else:
                 ts = x2gobroker.uccsjson.X2GoServer(
-                        host='{hostname}:{port}'.format(hostname=profiles[profile_id][u'host'][0], port=profiles[profile_id][u'sshport']),
+                        host='{hostname}:{port}'.format(hostname=hosts[0], port=profiles[profile_id][u'sshport']),
                         name=profiles[profile_id][u'name'],
                         username=profiles[profile_id][u'user'],
                 )


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