mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-10-06 03:18:46 +02:00
auto-t: fix agent path timing issue
The agent path was generated based on the current time which sometimes yielded duplicate paths if agents were created quickly after one another. Instead a simple iterator removes any chance of a duplicate path.
This commit is contained in:
parent
957a8aac25
commit
2a6690e50d
@ -705,17 +705,22 @@ class OrderedNetwork(object):
|
|||||||
str(self.signal_strength)) + '\n'\
|
str(self.signal_strength)) + '\n'\
|
||||||
'\tObject: \n' + self.network_object.__str__('\t\t')
|
'\tObject: \n' + self.network_object.__str__('\t\t')
|
||||||
|
|
||||||
|
agent_count = 0
|
||||||
|
|
||||||
class PSKAgent(dbus.service.Object):
|
class PSKAgent(dbus.service.Object):
|
||||||
|
|
||||||
def __init__(self, passphrases=[], users=[]):
|
def __init__(self, passphrases=[], users=[]):
|
||||||
|
global agent_count
|
||||||
|
|
||||||
if type(passphrases) != list:
|
if type(passphrases) != list:
|
||||||
passphrases = [passphrases]
|
passphrases = [passphrases]
|
||||||
self.passphrases = passphrases
|
self.passphrases = passphrases
|
||||||
if type(users) != list:
|
if type(users) != list:
|
||||||
users = [users]
|
users = [users]
|
||||||
self.users = users
|
self.users = users
|
||||||
self._path = '/test/agent/' + str(int(round(time.time() * 1000)))
|
self._path = '/test/agent/%s' % agent_count
|
||||||
|
|
||||||
|
agent_count += 1
|
||||||
|
|
||||||
dbus.service.Object.__init__(self, dbus.SystemBus(), self._path)
|
dbus.service.Object.__init__(self, dbus.SystemBus(), self._path)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user