summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Cardace <acardace@redhat.com>2020-03-12 19:04:04 +0100
committerAntonio Cardace <acardace@redhat.com>2020-03-18 09:51:55 +0100
commitc8941911adf0074b480304d2aee506e339c3c69e (patch)
treed7e4724b2947a69c118295d3b12ec38457974069
parent8fe2046f0858970531a599894683710e66fd22a7 (diff)
downloadNetworkManager-c8941911adf0074b480304d2aee506e339c3c69e.tar.gz
ifcfg-rh: add 'timestamp' property before comparing a reread connection
Since ifcfg-rh doesn't write out to file the 'connection.timestamp' property let's add it before comparing an updated connection with the plugin's reread one otherwise the comparison operation would always fail. The fix is not necessary for the keyfile plugin, because the reader/writer correctly reads/writes the connection timestamp.
-rw-r--r--src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c
index 2d7f9853d4..07a5f5dd34 100644
--- a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c
+++ b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c
@@ -3254,6 +3254,11 @@ nms_ifcfg_rh_writer_write_connection (NMConnection *connection,
_LOGW ("write: failure to re-read connection \"%s\": %s",
svFileGetName (ifcfg), "connection is unhandled");
} else {
+ /* ifcfg-rh doesn't support the 'timestamp' property, let's add it here */
+ g_object_set (nm_connection_get_setting_connection (reread),
+ NM_SETTING_CONNECTION_TIMESTAMP,
+ nm_setting_connection_get_timestamp (nm_connection_get_setting_connection (connection)),
+ NULL);
if (out_reread_same) {
reread_same = nm_connection_compare (reread, connection, NM_SETTING_COMPARE_FLAG_EXACT);
if (!reread_same) {