From 24df5942038fb9ddaf3c590f47c449d6c372801b Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Thu, 12 Aug 2010 13:10:36 +0000 Subject: Add the MAC address to the data that gets hashed to get an activity_id --- diff --git a/src/sugar/activity/activityfactory.py b/src/sugar/activity/activityfactory.py index 4789c33..17f18bc 100644 --- a/src/sugar/activity/activityfactory.py +++ b/src/sugar/activity/activityfactory.py @@ -22,6 +22,7 @@ the moment there is no reason to stabilize this API. """ import logging +import uuid import dbus import gobject @@ -64,28 +65,7 @@ def _close_fds(): def create_activity_id(): """Generate a new, unique ID for this activity""" - pservice = presenceservice.get_instance() - - # create a new unique activity ID - i = 0 - act_id = None - while i < 10: - act_id = util.unique_id() - i += 1 - - # check through network activities - found = False - logging.info('KILL_PS check the activity_id is not used in the network') - """ - activities = pservice.get_activities() - for act in activities: - if act_id == act.props.id: - found = True - break - """ - if not found: - return act_id - raise RuntimeError("Cannot generate unique activity id.") + return util.unique_id(uuid.getnode()) def get_environment(activity): -- cgit v0.9.1