Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu.vizoso@collabora.co.uk>2010-08-12 13:10:36 (GMT)
committer Tomeu Vizoso <tomeu.vizoso@collabora.co.uk>2010-08-20 13:33:53 (GMT)
commit24df5942038fb9ddaf3c590f47c449d6c372801b (patch)
treedd8b9067124b39e557085db0f96a2b2010f6973c
parentd5dbe3616f2cf27e33b7ffdfa258f1719022e189 (diff)
Add the MAC address to the data that gets hashed to get an activity_id
-rw-r--r--src/sugar/activity/activityfactory.py24
1 files changed, 2 insertions, 22 deletions
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):