@@ -56,7 +56,6 @@ public class AuthnScriptsReloader extends JobListenerSupport {
56
56
57
57
private String scriptsJobName ;
58
58
private Map <String , Long > scriptFingerPrints ;
59
- private String pythonLibLocation ;
60
59
61
60
public void init (int gap ) {
62
61
try {
@@ -87,7 +86,7 @@ public void jobToBeExecuted(JobExecutionContext context) {
87
86
88
87
logger .debug ("AuthnScriptsReloader. Running timer job for acrs: {}" , acrs .toString ());
89
88
//In Gluu, every time a single script is changed via oxTrust, all custom scripts are reloaded. This is
90
- //not the case when for instance, the oxRevision attribute of a cust script is altered manually (as when developing)
89
+ //not the case when for instance, the jansRevision attribute of a cust script is altered manually (as when developing)
91
90
//In the future, oxTrust should only reload the script that has changed for performance reasons.
92
91
for (String acr : acrs ) {
93
92
script = persistenceService .getScript (acr );
@@ -169,7 +168,7 @@ public void jobToBeExecuted(JobExecutionContext context) {
169
168
long rev = Optional .ofNullable (script .getRevision ()).map (r -> r == Long .MAX_VALUE ? 0 : r ).orElse (0L );
170
169
script .setRevision (rev + 1 );
171
170
if (persistenceService .modify (script )) {
172
- logger .debug ("oxRevision updated for script '{}'" , script .getDisplayName ());
171
+ logger .debug ("jansRevision updated for script '{}'" , script .getDisplayName ());
173
172
}
174
173
break ;
175
174
default :
@@ -186,14 +185,8 @@ public void jobToBeExecuted(JobExecutionContext context) {
186
185
187
186
@ PostConstruct
188
187
private void inited () {
189
-
190
188
scriptsJobName = getClass ().getSimpleName () + "_scripts" ;
191
189
scriptFingerPrints = new HashMap <>();
192
-
193
- //the following works fine in both windows dev environment, and linux VMs
194
- pythonLibLocation = Utils .onWindows () ? System .getenv ("PYTHON_HOME" ) + File .separator + "Lib" : "/opt/gluu/python/libs" ;
195
- logger .info ("Using {} as python's lib path" , pythonLibLocation );
196
-
197
190
}
198
191
199
192
private void copyToLibsDir (CustomScript script ) {
@@ -203,7 +196,7 @@ private void copyToLibsDir(CustomScript script) {
203
196
byte [] contents = getScriptContents (script );
204
197
205
198
if (contents != null ) {
206
- Path destPath = Paths .get (pythonLibLocation , MessageFormat .format (FILENAME_TEMPLATE , acr ));
199
+ Path destPath = Paths .get (persistenceService . getPythonLibLocation () , MessageFormat .format (FILENAME_TEMPLATE , acr ));
207
200
Files .write (destPath , contents );
208
201
logger .trace ("The script for acr '{}' has been copied to {}" , acr , destPath .toString ());
209
202
} else {
0 commit comments