Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: X2Go dev team <git-admin-P0WSJaAXTow <at> public.gmane.org>
Subject: x2gobroker.git - master (branch) updated: f7c7559f78ec6d50ce8bd614a4409b2e9f8c34d1
Newsgroups: gmane.linux.terminal-server.x2go.scm
Date: Friday 25th January 2013 09:46:54 UTC (over 3 years ago)
The branch, master has been updated
       via  f7c7559f78ec6d50ce8bd614a4409b2e9f8c34d1 (commit)
      from  cd2f1b70fede3a52d4da401da27780e6ab813f6d (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 f7c7559f78ec6d50ce8bd614a4409b2e9f8c34d1
Author: Mike Gabriel

Date:   Fri Jan 25 10:47:39 2013 +0100

    make sure that the profile default are deleted from the session profile

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

Summary of changes:
 x2gobroker/brokers/inifile_broker.py    |    2 ++
 x2gobroker/tests/test_broker_inifile.py |   11 ++++++++---
 2 files changed, 10 insertions(+), 3 deletions(-)

The diff of changes is:
diff --git a/x2gobroker/brokers/inifile_broker.py
b/x2gobroker/brokers/inifile_broker.py
index 697af16..1ef5418 100644
--- a/x2gobroker/brokers/inifile_broker.py
+++ b/x2gobroker/brokers/inifile_broker.py
@@ -72,6 +72,8 @@ class X2GoBroker(base.X2GoBroker):
         for key in profile.keys():
             if key.startswith('acl-'):
                 del profile[key]
+            if key == 'default':
+                del profile[key]
         return profile
 
     def get_profile_acls(self, profile_id):
diff --git a/x2gobroker/tests/test_broker_inifile.py
b/x2gobroker/tests/test_broker_inifile.py
index 2beabf7..282a7d1 100644
--- a/x2gobroker/tests/test_broker_inifile.py
+++ b/x2gobroker/tests/test_broker_inifile.py
@@ -39,6 +39,14 @@ class TestX2GoBrokerBackendInifile(unittest.TestCase):
         for _id in _expected_profile_ids:
             self.assertTrue( ( _id in _profile_ids ) )
 
+    ### TEST SESSION PROFILES: get_profile() (check that the default key
is _not_ present)
+
+    def test_getprofile_defaultkey(self):
+        inifile_backend =
inifile.X2GoBroker(profile_config_file='../../etc/broker/x2gobroker-sessionprofiles.conf')
+        _profile_ids = inifile_backend.get_profile_ids()
+        for _profile_id in _profile_ids:
+            self.assertTrue( ( 'default' not in
inifile_backend.get_profile(_profile_id).keys() ) )
+
     ### TEST SESSION PROFILES: get_profile_defaults()
 
     def test_getprofiledefaults(self):
@@ -110,21 +118,18 @@ acl-users-order = deny-allow
             'fullscreen': True,
         })
         _profile1 = inifile_backend.get_profile('testprofile1')
-        del _profile1['default']
         for key in _expected_profile1.keys():
             self.assertTrue( ( key in _profile1.keys() ) )
         for key in _profile1.keys():
             self.assertTrue( ( key in _expected_profile1.keys()  and
_profile1[key] == _expected_profile1[key] ) )
 
         _profile2 = inifile_backend.get_profile('testprofile2')
-        del _profile2['default']
         for key in _expected_profile2.keys():
             self.assertTrue( ( key in _profile2.keys() ) )
         for key in _profile2.keys():
             self.assertTrue( ( key in _expected_profile2.keys() ) and (
_profile2[key] == _expected_profile2[key] ) )
 
         _profile3 = inifile_backend.get_profile('testprofile3')
-        del _profile3['default']
         for key in _expected_profile3.keys():
             self.assertTrue( ( key in _profile3.keys() ) )
         for key in _profile3.keys():


hooks/post-receive
 
CD: 16ms