title: Starting bluez-simple-agent giving an Exception Error: Already Exists
body: <p>I am using the bluez-simple-agent on Ubuntu and starting it with su -c bluez-simple-agent. After that I am getting an exception like this:</p>
  
  <pre><code>Traceback (most recent call last):   File "/usr/bin/bluez-simple-agent", line 133, in &lt;module&gt;
      adapter.RegisterAgent(path, capability)   File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 70, in
  __call__
      return self._proxy_method(*args, **keywords)   File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 145, in
  __call__
      **keywords)   File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
      message, timeout) dbus.exceptions.DBusException: org.bluez.Error.AlreadyExists: Already Exists
  </code></pre>
  
  <p>A codesnippet of bluez-simple-agent:</p>
  
  <pre><code>if __name__ == '__main__':
  dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
  
  bus = dbus.SystemBus()
  manager = dbus.Interface(bus.get_object("org.bluez", "/"),
                          "org.bluez.Manager")
  
  capability = "DisplayYesNo"
  
  parser = OptionParser()
  parser.add_option("-c", "--capability", action="store",
                  type="string", dest="capability")
  (options, args) = parser.parse_args()
  if options.capability:
      capability  = options.capability
  
  if len(args) &gt; 0:
      path = manager.FindAdapter(args[0])
  else:
      path = manager.DefaultAdapter()
  
  adapter = dbus.Interface(bus.get_object("org.bluez", path),
                          "org.bluez.Adapter")
  
  path = "/test/agent"
  agent = Agent(bus, path)
  
  mainloop = gobject.MainLoop()
  
  if len(args) &gt; 1:
      if len(args) &gt; 2:
  
          device = adapter.FindDevice(args[1])
  
          adapter.RemoveDevice(device)
  
      agent.set_exit_on_release(False)
  
      adapter.CreatePairedDevice(args[1], path, capability,
                  reply_handler=create_device_reply,
                  error_handler=create_device_error)
  else:
      adapter.RegisterAgent(path, capability)
      print "Agent registered"
  
  mainloop.run()
  </code></pre>
  
  <p>How can I fix that problem?</p>