Add the MAC address to the data that gets hashed to get an activity_id
This commit is contained in:
parent
d5dbe3616f
commit
24df594203
@ -22,6 +22,7 @@ the moment there is no reason to stabilize this API.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
import uuid
|
||||||
|
|
||||||
import dbus
|
import dbus
|
||||||
import gobject
|
import gobject
|
||||||
@ -64,28 +65,7 @@ def _close_fds():
|
|||||||
|
|
||||||
def create_activity_id():
|
def create_activity_id():
|
||||||
"""Generate a new, unique ID for this activity"""
|
"""Generate a new, unique ID for this activity"""
|
||||||
pservice = presenceservice.get_instance()
|
return util.unique_id(uuid.getnode())
|
||||||
|
|
||||||
# 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.")
|
|
||||||
|
|
||||||
|
|
||||||
def get_environment(activity):
|
def get_environment(activity):
|
||||||
|
Loading…
Reference in New Issue
Block a user