Re: org.freedesktop.NetworkManager.Settings.PropertiesChanged deprecated



On Wed, 2021-07-14 at 13:10 +0200, mh mike franken de wrote:
Hi *,

since NetworkManager 1.22 using the signal
org.freedesktop.NetworkManager.
Settings.PropertiesChanged is deprecated. One should use
org.freedesktop.
DBus.Properties.PropertiesChanged instead. Since NetworkManager 1.32
this 
signal indeed is completely removed.
I couldn't find any example on how to easily replace the code using
the 
deprecated signal. I use PropertiesChanged to listen for connectivity
changes, 
escpecially activation/deactivation of interfaces.
Goal is to configure a few things, whenever connections were
(de)activated.

I use the perl module Net::DBus for this job.
The following snippet shows how far I got up to date:

  my $busobjpath = "/org/freedesktop/DBus/Properties";

Such an object path does not exist on NetworkManager's D-Bus API.

Object paths start with "/org/freedesktop/NetworkManager".

See all object with `d-feet` or `busctl tree
org.freedesktop.NetworkManager`.

  my $busif = "org.freedesktop.DBus.Properties";
  my( $oBUSIF ) = $oBUSSVC->get_object( $busobjpath, $busif ) || die
$!;
  $oBUSIF->connect_to_signal(
        "PropertiesChanged", sub {
          &{ \&onPropertiesChanged }( @_ )
        } || die $!;
    }
  }
  my( $reactor ) = Net::DBus::Reactor->main();
  $reactor->run();

The code seems to work, but it does not react on any changes
regarding 
Networkmanager connections, at least onPropertiesChanged is never
called.
The old code was using NetworkManager's special PropertiesChanged
signal and 
worked as expected.

Any idea?

Thx and bye.
Michael.


Too bad that there was still a user of this API. We wouldn't have
dropped it yet, if we had been aware of existing users. But it's hard
to know who uses an API, unless you break it. Sorry about the breakage.



best,
Thomas



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