Ticket #7764 (closed enhancement: fixed)

Opened 6 years ago

Last modified 6 years ago

Reset Registration with school servers - short term solution

Reported by: kimquirk Owned by: erikos
Priority: blocker Milestone: 9.1.0-cancelled
Component: sugar Version: not specified
Keywords: r? joyride-2330:? relnote Cc: gregorio, joe, mchua, frances
Action Needed: review Verified: no
Deployments affected: Blocked By:
Blocking:

Description

Laptops should automatically register and re-register with school servers when they detect that they are connected to a new one. In today's builds (8.2), you have to push a button to register, and there is no way to unregister or reregister with a new school.

This is the feature request that matches up with the short term fix for 8.2 to allow resetting of the registration through the control panel.

Attachments

7765-reset.patch Download (2.1 KB) - added by erikos 6 years ago.
cli command to reset the school server
7765-reset-2.patch Download (2.1 KB) - added by erikos 6 years ago.
added restart and saving of the profile
7764-v3.patch Download (1.4 KB) - added by erikos 6 years ago.
make the default value for the backup url an empty string

Change History

Changed 6 years ago by kimquirk

  • type changed from defect to enhancement

Changed 6 years ago by gregorio

  • cc gregorio added
  • owner changed from gregorio to mstone

Please make a CLI option for this as discussed in the recent release meeting.

Changed 6 years ago by kimquirk

  • keywords blocks:8.2.0 r? added
  • component changed from not assigned to sugar
  • summary changed from Reset Registration with school servers to Reset Registration with school servers - short term solution

To clarify, this is the short term fix request. I just need the one CLI command to remove the schoolserver items from the config file. This will not deal with issues on the school server.

Changed 6 years ago by erikos

cli command to reset the school server

Changed 6 years ago by erikos

  • next_action changed from never set to review

Changed 6 years ago by marco

  • keywords r- added; r? removed

I think the options handling could be cleanup up a lot, but this is consistent with the code we have there right now and it's no good time for refactoring. We should open a separate ticket about it.

I don't think the patch really works. Command line is in a separate process. I guess you should save the profile and require a restart.

Changed 6 years ago by erikos

added restart and saving of the profile

Changed 6 years ago by erikos

  • keywords r? added; r- removed

Changed 6 years ago by marco

  • keywords r+ added; r? removed

Changed 6 years ago by erikos

  • next_action changed from review to package

pushed to git

Changed 6 years ago by marco

  • next_action changed from package to test in build

Changed 6 years ago by marco

  • priority changed from high to blocker

Changed 6 years ago by erikos

  • keywords joyride-2330:? added
  • next_action changed from test in build to qa signoff

|TestCase|

connect to a schoolserver using the 'Register' option in the xo-palette on the home-view. open a terminal activity and use the command line interface of the control panel to reset the registration 'sugar-control-panel -c registration'. After restarting sugar try to connect to the schoolserver again.

Changed 6 years ago by kimquirk

  • keywords relnote added

Changed 6 years ago by joe

  • cc joe added

Changed 6 years ago by mchua

  • owner changed from mstone to frances

assigning to frances to test and verify in release candidate - see above testcase by erikos.

Changed 6 years ago by mchua

  • owner changed from frances to erikos
  • next_action changed from qa signoff to unknown

This doesn't seem to be fixed yet. On a freshly installed (copy-nand) 765 (gg-765-2, to be exact) running the test case erikos put up does not pass, as the 'Register' option doesn't reappear in the XO-palette in Home view after running the '-c registration' command. (Am I missing something?)

I also tried (separately) typing the sugar-control-panel command in Terminal as root, and rebooting the entire machine (instead of just restarting Sugar), to no avail. Handing back to erikos.

Changed 6 years ago by gregorio

  • keywords blocks-:8.2.0 added; blocks:8.2.0 removed

Hi Erikos,

Is this fixed?

Why can't we verify it?

Thanks,

Greg S

Changed 6 years ago by kimquirk

  • keywords blocks-:8.2.0 removed
  • milestone changed from 8.2.0 (was Update.2) to 9.1.0

Doesn't work for me in 8.2-767.

Changed 6 years ago by erikos

make the default value for the backup url an empty string

Changed 6 years ago by erikos

  • keywords r? added; r+ removed
  • next_action changed from unknown to review

The patch above for sugar-toolkit (which makes the backup-url an empty string by default) and the change (pro.backup1 = ) below in sugar should fix the issue. Tested on the XO, without an actual schoolserver though.

def clear_registration():
    """Clear the registration with the schoolserver                                                                                         
    """
    pro = profile.get_profile()
    pro.backup1 = None
    pro.save()
    return 1

So to fix this we would need a new sugar and sugar-toolkit package :/

Changed 6 years ago by erikos

This is the clearer patch for sugar.

diff --git a/src/controlpanel/model/network.py b/src/controlpanel/model/network.py
index cbe0473..b70c952 100644
--- a/src/controlpanel/model/network.py
+++ b/src/controlpanel/model/network.py
@@ -87,7 +87,7 @@ def clear_registration():
     """Clear the registration with the schoolserver
     """
     pro = profile.get_profile()
-    pro.backup1 = None
+    pro.backup1 = ''
     pro.save()
     return 1

Changed 6 years ago by marco

Simon, can you explain why the current code does not work.

Changed 6 years ago by erikos

Changed 6 years ago by erikos

After discussion with marco, we decided that removing the option might be the better solution. This actually would only need a change in sugar-toolkit as well.

diff --git a/src/sugar/profile.py b/src/sugar/profile.py
index 1b08202..6c5dcd2 100644
--- a/src/sugar/profile.py
+++ b/src/sugar/profile.py
@@ -102,8 +102,13 @@ class Profile(object):
             _set_key(cp, 'Buddy', 'NickName', self.nick_name.encode('utf8'))
         if self.color:
             _set_key(cp, 'Buddy', 'Color', self.color.to_string())
-        if self.backup1:
+
+        if self.backup1 is None:
+            if cp.has_option('Server', 'Backup1'):
+                cp.remove_section('Server')
+        else:
             _set_key(cp, 'Server', 'Backup1', self.backup1)
+
         if self.jabber_server is not None:
             _set_key(cp, 'Jabber', 'Server', self.jabber_server)
 

Changed 6 years ago by erikos

  • cc mchua added

joyride-2513 has the fix. Can someone with a schoolserver please test?

Changed 6 years ago by joe

  • cc frances added

Changed 6 years ago by mchua

  • status changed from new to closed
  • resolution set to fixed

tested with joyride-2513 - verified w/ XS at 1cc.

Note: See TracTickets for help on using tickets.