Opened 14 years ago

Last modified 10 years ago

#1976 reopened defect

School server registration works differently on XO

Reported by: sascha_silbe Owned by: timClicks
Priority: Low Milestone: Unspecified
Component: Sugar Version: Git as of bugdate
Severity: Minor Keywords:
Cc: martin.langhoff Distribution/OS:
Bug Status: Unconfirmed

Description

The school server URL is hardcoded if running on an XO, but derived from the jabber server setting on other hardware. From src/jarabe/desktop/schoolserver.py:

REGISTER_URL = 'http://schoolserver:8080/'

[...]

def register_laptop(url=REGISTER_URL):

    profile = get_profile()
    client = gconf.client_get_default()

    if have_ofw_tree():
        sn = read_ofw('mfg-data/SN')
        uuid_ = read_ofw('mfg-data/U#')
        sn = sn or 'SHF00000000'
        uuid_ = uuid_ or '00000000-0000-0000-0000-000000000000'
    else:
        sn = generate_serial_number()
        uuid_ = str(uuid.uuid1())
        setting_name = '/desktop/sugar/collaboration/jabber_server'
        jabber_server = client.get_string(setting_name)
        store_identifiers(sn, uuid_, jabber_server)
        url = 'http://' + jabber_server + ':8080/'

We shouldn't make assumptions on the use case based on the hardware.

Attachments (2)

remove_hardcoded_server_url.patch (1.2 KB) - added by timClicks 14 years ago.
untested fix
SL1976.patch (2.3 KB) - added by martin.langhoff 13 years ago.

Download all attachments as: .zip

Change History (14)

comment:1 Changed 14 years ago by bernie

I think we should use the 'http://' + jabber_server + ':8080/' method in both cases, and make jabber_server default to 'schoolserver' when empty or unset.

Changed 14 years ago by timClicks

untested fix

comment:2 Changed 14 years ago by timClicks

  • Keywords r? added
  • Owner changed from tomeu to timClicks
  • Status changed from new to accepted

comment:3 Changed 14 years ago by tomeu

  • Keywords r! added; r? removed

Removing from the queue until feedback in the mailing list is addressed.

comment:4 Changed 13 years ago by FGrose

  • seeta_dev set to unassigned

comment:5 Changed 13 years ago by tomeu

  • Resolution set to fixed
  • Status changed from accepted to closed

comment:6 Changed 13 years ago by martin.langhoff

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:7 follow-up: Changed 13 years ago by martin.langhoff

Thanks for looking into this! I disagree with the fix, however.

The patch is bogus -- there was bogus logic in the non-XO codepath, and this patch promotes the bogosity to all the cases.

Here is how I believe this comes to happen: when we are on a non-XO, we want to generate synthetic SN/UUID pars, and to store them permanently, so we always use the same SN/UUID in the future, even if the registration fails. There is _no_ reason to try save a jabber server, other than perhaps making store_identifiers() happy.

The old code has several problems

  • On non-XO, it always creates an SN/UUID pair
  • On non-XO, it saves a bogus jabber server before even trying to register

I am attaching an untested, draft patch trying to explain what I mean. I am a bit confused by SN/UUID being kept in something other than gconf. Should we consolidate these values into gconf?

Changed 13 years ago by martin.langhoff

comment:8 Changed 13 years ago by martin.langhoff

  • Cc martin.langhoff added

comment:9 in reply to: ↑ 7 Changed 13 years ago by sascha_silbe

  • Keywords r! removed

Replying to martin.langhoff:

I am attaching an untested, draft patch trying to explain what I mean. I am a bit confused by SN/UUID being kept in something other than gconf. Should we consolidate these values into gconf?

Saving in gconf sounds good to me. Can you change your patch accordingly and post it to sugar-devel (see Code Review), please?

comment:10 Changed 11 years ago by dnarvaez

  • Milestone changed from 0.90 to Unspecified

comment:11 Changed 11 years ago by dnarvaez

  • Bug Status changed from New to Unconfirmed

comment:12 Changed 10 years ago by tch

  • Priority changed from Unspecified by Maintainer to Low
Note: See TracTickets for help on using tickets.