This commit is contained in:
Paolo Fabriani 2016-11-23 16:33:17 +00:00
parent 57762a41f5
commit f09b9a2d18
4 changed files with 12 additions and 8 deletions

View File

@ -212,17 +212,17 @@ public class AnsibleBridge {
*/ */
public Collection<Role> generateRoles(Dependency d) { public Collection<Role> generateRoles(Dependency d) {
Collection<Role> roles = new Vector<>(); Collection<Role> roles = new Vector<>();
if("os".equals(d.getType())) { if("os".equalsIgnoreCase(d.getType())) {
OSDependencyPackage pkg = new OSDependencyPackage(d); OSDependencyPackage pkg = new OSDependencyPackage(d);
if(pkg!=null) { if(pkg!=null) {
roles.addAll(pkg.getRoles(this.getTemplateManager())); roles.addAll(pkg.getRoles(this.getTemplateManager()));
} }
} else if("custom".equals(d.getType())) { } else if("custom".equalsIgnoreCase(d.getType())) {
CustomDependencyPackage pkg = new CustomDependencyPackage(d); CustomDependencyPackage pkg = new CustomDependencyPackage(d);
if(pkg!=null) { if(pkg!=null) {
roles.addAll(pkg.getRoles(this.getCustomRoleManager())); roles.addAll(pkg.getRoles(this.getCustomRoleManager()));
} }
} else if("cran".equals(d.getType())) { } else if("cran".equalsIgnoreCase(d.getType())) {
CranDependencyPackage pkg = new CranDependencyPackage(d); CranDependencyPackage pkg = new CranDependencyPackage(d);
if(pkg!=null) { if(pkg!=null) {
roles.addAll(pkg.getRoles(this.getTemplateManager())); roles.addAll(pkg.getRoles(this.getTemplateManager()));

View File

@ -22,7 +22,15 @@ public class AlgorithmPackage {
protected Map<String, String> getDictionary(Algorithm a) { protected Map<String, String> getDictionary(Algorithm a) {
Map<String, String> out = new HashMap<String, String>(); Map<String, String> out = new HashMap<String, String>();
out.put("name", a.getName()); out.put("name", a.getName());
out.put("category", a.getCategory());
out.put("class", a.getClazz());
out.put("p5", "TEMP_TRANSDUCERS");
out.put("p6", "TEMP_??");
out.put("vre", "FAKE_VRE");
out.put("packageurl", a.getPackageURL());
out.put("description", a.getDescription());
String deps = ""; String deps = "";
for(Dependency d:a.getDependencies()) { for(Dependency d:a.getDependencies()) {
deps+=String.format("- { role: %s }\n", d.getType()+"-"+d.getName()); deps+=String.format("- { role: %s }\n", d.getType()+"-"+d.getName());
} }

View File

@ -159,7 +159,7 @@ public class AlgorithmPackageParser {
for (String pkg : dependencies) { for (String pkg : dependencies) {
Dependency dep = new Dependency(); Dependency dep = new Dependency();
dep.setName(pkg); dep.setName(pkg);
dep.setType("OS"); dep.setType("os");
out.addDependency(dep); out.addDependency(dep);
} }
} }

View File

@ -119,8 +119,4 @@ public class DataminerPoolManager {
} }
// private void updateClusters() {
// System.out.println("flushing changes to all clusters");
// }
} }