seveas / python-networkmanager

Easy communication with NetworkManager
http://packages.python.org/python-networkmanager/
Other
163 stars 90 forks source link

info.py no permission issue #64

Closed sunbearc22 closed 1 year ago

sunbearc22 commented 6 years ago

I was trying out python-networkmanager/examples/info.py but received the following permission issue. How do i overcome this permission issue? I tried the script in Ubuntu 16.04 with python 3.6.7, and with existing NetworkManager service enabled and disabled.

Traceback (most recent call last):
  File "~/git/test_networkmanager.py", line 45, in <module>
    for conn in NetworkManager.Settings.ListConnections():
  File "<string>", line 8, in ListConnections
  File "~/.local/share/virtualenvs/git-icaXKgBz/lib/python3.6/site-packages/NetworkManager.py", line 550, in to_python
    val = fixups.base_to_python(val)
  File "~/.local/share/virtualenvs/git-icaXKgBz/lib/python3.6/site-packages/NetworkManager.py", line 607, in base_to_python
    return [fixups.base_to_python(x) for x in val]
  File "~/.local/share/virtualenvs/git-icaXKgBz/lib/python3.6/site-packages/NetworkManager.py", line 607, in <listcomp>
    return [fixups.base_to_python(x) for x in val]
  File "~/.local/share/virtualenvs/git-icaXKgBz/lib/python3.6/site-packages/NetworkManager.py", line 620, in base_to_python
    return globals()[classname](val)
  File "~/.local/share/virtualenvs/git-icaXKgBz/lib/python3.6/site-packages/NetworkManager.py", line 304, in __init__
    self.uuid = self.GetSettings()['connection']['uuid']
  File "<string>", line 3, in GetSettings
  File "~/.local/share/virtualenvs/git-icaXKgBz/lib/python3.6/site-packages/dbus/proxies.py", line 70, in __call__
    return self._proxy_method(*args, **keywords)
  File "~/.local/share/virtualenvs/git-icaXKgBz/lib/python3.6/site-packages/dbus/proxies.py", line 145, in __call__
    **keywords)
  File "~/.local/share/virtualenvs/git-icaXKgBz/lib/python3.6/site-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.NetworkManager.Settings.PermissionDenied: uid 1000 has no permission to perform this operation
Hadatko commented 3 years ago

Did you try sudo when runnign script?

seveas commented 1 year ago

Closing all PR's and issues prior to archiving this repository.