Problem with passing list of strings to load_connections



Hello,

I'm trying to reload ifcfg file via Python. load_client method should
accept array of strings [1], but when I pass list of strings to it, it
fails with "TypeError: Must be string, not list". When I pass just a
string, it crashes with segmentation fault. Is it a bug or should I
use a special object to pass list there?

In [1]: from gi.repository import NM
In [2]: c =  NM.Client.new(None)
In [3]: c.load_connections(['/etc/sysconfig/network-scripts/ifcfg-enp0s25'])
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-3-a9f903227329> in <module>()
----> 1 c.load_connections(['/etc/sysconfig/network-scripts/ifcfg-enp0s25'])

TypeError: Must be string, not list
In [4]: c.load_connections('/etc/sysconfig/network-scripts/ifcfg-enp0s25')
[1]    9816 segmentation fault  sudo ipython

I'm using NetworkManager 1.0.10. The fault occurred on both Python 2 and 3.

Thanks a lot,
Petr


[1] 
https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.Settings.html#gdbus-method-org-freedesktop-NetworkManager-Settings.LoadConnections


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]