This commit is contained in:
Nunzio Andrea Galante 2017-04-28 14:26:40 +00:00
parent 8409cfde2f
commit feebe094ab
2 changed files with 54 additions and 52 deletions

View File

@ -118,55 +118,54 @@ public class AnsibleWorker ***REMOVED***
public void apply(AlgorithmSet as, PrintStream ps, boolean updateSVN) throws IOException, InterruptedException, SVNException ***REMOVED***
***REMOVED*** TODO execute the playbook and return output
System.out.println(this.getWorkdir());
try ***REMOVED***
Process p = Runtime.getRuntime().exec("ansible-playbook -v -i " + this.getInventoryFile().getAbsolutePath() + " " + this.getPlaybookFile().getAbsolutePath());
public void apply(AlgorithmSet as, PrintStream ps, boolean updateSVN)
throws IOException, InterruptedException, SVNException ***REMOVED***
***REMOVED*** TODO execute the playbook and return output
System.out.println(this.getWorkdir());
try ***REMOVED***
Process p = Runtime.getRuntime().exec("ansible-playbook -v -i " + this.getInventoryFile().getAbsolutePath()
+ " " + this.getPlaybookFile().getAbsolutePath());
inheritIO(p.getInputStream(), ps);
inheritIO(p.getErrorStream(), ps);
if (updateSVN)***REMOVED***
int exitValue = p.waitFor();
if (exitValue == 0)***REMOVED***
for (Algorithm algo : as.getAlgorithms())***REMOVED***
for (Dependency d : algo.getDependencies()) ***REMOVED***
if (d.getType().equals("os")) ***REMOVED***
List<String> ls = new LinkedList<String>();
ls.add(d.getName());
this.updateSVN("r_deb_pkgs.txt", ls);
***REMOVED***
if (d.getType().equals("cran")) ***REMOVED***
List<String> ls = new LinkedList<String>();
ls.add(d.getName());
this.updateSVN("r_cran_pkgs.txt", ls);
***REMOVED***
if (d.getType().equals("github")) ***REMOVED***
List<String> ls = new LinkedList<String>();
ls.add(d.getName());
this.updateSVN("r_github_pkgs.txt", ls);
***REMOVED***
***REMOVED***
***REMOVED***
***REMOVED***
***REMOVED***
***REMOVED*** catch (IOException e) ***REMOVED***
e.printStackTrace();
***REMOVED***
***REMOVED***System.out.println("TODO: execute: ansible-playbook -v -i " + this.getInventoryFile().getName() + " " + this.getPlaybookFile().getName());
***REMOVED***
inheritIO(p.getInputStream(), ps);
inheritIO(p.getErrorStream(), ps);
if (updateSVN) ***REMOVED***
int exitValue = p.waitFor();
if (exitValue == 0) ***REMOVED***
for (Algorithm algo : as.getAlgorithms()) ***REMOVED***
for (Dependency d : algo.getDependencies()) ***REMOVED***
if (d.getType().equals("os")) ***REMOVED***
List<String> ls = new LinkedList<String>();
ls.add(d.getName());
this.updateSVN("r_deb_pkgs.txt", ls);
***REMOVED***
if (d.getType().equals("cran")) ***REMOVED***
List<String> ls = new LinkedList<String>();
ls.add(d.getName());
this.updateSVN("r_cran_pkgs.txt", ls);
***REMOVED***
if (d.getType().equals("github")) ***REMOVED***
List<String> ls = new LinkedList<String>();
ls.add(d.getName());
this.updateSVN("r_github_pkgs.txt", ls);
***REMOVED***
***REMOVED***
***REMOVED***
***REMOVED***
***REMOVED***
***REMOVED*** catch (IOException e) ***REMOVED***
e.printStackTrace();
***REMOVED***
***REMOVED*** System.out.println("TODO: execute: ansible-playbook -v -i " +
***REMOVED*** this.getInventoryFile().getName() + " " +
***REMOVED*** this.getPlaybookFile().getName());
***REMOVED***

View File

@ -96,7 +96,8 @@ public class HAProxy ***REMOVED***
***REMOVED*** prod
***REMOVED*** URL stockURL = new
***REMOVED*** URL("http:***REMOVED***data.d4science.org/Yk4zSFF6V3JOSytNd3JkRDlnRFpDUUR5TnRJZEw2QjRHbWJQNStIS0N6Yz0");
URL stockURL = new URL("http:***REMOVED***" + ISClient.getHProxy() + ":8880/;csv");
***REMOVED***URL stockURL = new URL("http:***REMOVED***"+ ISClient.getHProxy() +":8880/;csv");
URL stockURL = new URL("http:***REMOVED***data.d4science.org/c29KTUluTkZnRlB0WXE5NVNaZnRoR0dtYThUSmNTVlhHbWJQNStIS0N6Yz0");
System.out.println(stockURL);
***REMOVED*** dev
***REMOVED*** URL stockURL = new
@ -109,12 +110,14 @@ public class HAProxy ***REMOVED***
continue;
***REMOVED***
if (nextLine[0].equals(cluster.getName())) ***REMOVED***
a.setName(nextLine[1]);
out.add(a);
System.out.println(a.getFullyQualifiedName());
Host b = new Host();
b.setName(nextLine[1]);
out.add(b);
System.out.println(b.getFullyQualifiedName());
***REMOVED***
***REMOVED***
***REMOVED***
System.out.println(out);
return out;
***REMOVED***