Skip to content

Commit

Permalink
Refresh the salt modules after refreshing the pillar
Browse files Browse the repository at this point in the history
As mentioned in saltstack/salt#58197 (comment)
the refresh_pillar doesn't set the new pillar on the modules. This
causes the beacons to still use the old configuraton.
  • Loading branch information
cbosdo committed Jul 21, 2021
1 parent 3c97ed2 commit 10df03b
Showing 1 changed file with 11 additions and 3 deletions.
Expand Up @@ -14,8 +14,6 @@
*/
package com.suse.manager.webui.services.impl;

import com.google.gson.JsonElement;
import com.google.gson.reflect.TypeToken;
import com.redhat.rhn.common.client.ClientCertificate;
import com.redhat.rhn.common.conf.ConfigDefaults;
import com.redhat.rhn.common.messaging.JavaMailException;
Expand All @@ -24,6 +22,7 @@
import com.redhat.rhn.domain.server.ServerFactory;
import com.redhat.rhn.manager.audit.scap.file.ScapFileManager;
import com.redhat.rhn.manager.system.SystemManager;

import com.suse.manager.clusters.ClusterProviderParameters;
import com.suse.manager.reactor.PGEventStream;
import com.suse.manager.reactor.messaging.ApplyStatesEventMessage;
Expand All @@ -40,8 +39,8 @@
import com.suse.manager.webui.services.impl.runner.MgrUtilRunner;
import com.suse.manager.webui.utils.ElementCallJson;
import com.suse.manager.webui.utils.gson.BootstrapParameters;
import com.suse.manager.webui.utils.salt.custom.MgrActionChains;
import com.suse.manager.webui.utils.salt.custom.ClusterOperationsSlsResult;
import com.suse.manager.webui.utils.salt.custom.MgrActionChains;
import com.suse.manager.webui.utils.salt.custom.PkgProfileUpdateSlsResult;
import com.suse.manager.webui.utils.salt.custom.ScheduleMetadata;
import com.suse.salt.netapi.AuthModule;
Expand Down Expand Up @@ -81,6 +80,10 @@
import com.suse.salt.netapi.results.Result;
import com.suse.salt.netapi.results.SSHResult;
import com.suse.utils.Opt;

import com.google.gson.JsonElement;
import com.google.gson.reflect.TypeToken;

import org.apache.http.client.config.CookieSpecs;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.impl.nio.client.CloseableHttpAsyncClient;
Expand Down Expand Up @@ -722,6 +725,11 @@ public void refreshPillar(MinionList minionList) {
LocalCall<Boolean> call = SaltUtil.refreshPillar(Optional.empty(),
Optional.empty());
callAsync(call, minionList);

// Salt pillar refresh doesn't reload the modules with the new pillar
LocalCall<Boolean> modulesRefreshCall = new LocalCall<>("saltutil.refresh_modules",
Optional.empty(), Optional.empty(), new TypeToken<Boolean>() { });
callAsync(modulesRefreshCall, minionList);
}
catch (SaltException e) {
throw new RuntimeException(e);
Expand Down

0 comments on commit 10df03b

Please sign in to comment.