33 lines
997 B
Java
33 lines
997 B
Java
package org.gcube.dataanalysis.dataminer.poolmanager.ansiblebridge.template;
|
|
|
|
import java.io.File;
|
|
***REMOVED***
|
|
import java.util.NoSuchElementException;
|
|
|
|
import org.gcube.dataanalysis.dataminer.poolmanager.ansible.model.Role;
|
|
import org.gcube.dataanalysis.dataminer.poolmanager.ansiblebridge.AnsibleSerializeHelper;
|
|
|
|
public class CustomRoleManager ***REMOVED***
|
|
|
|
private String root;
|
|
|
|
public CustomRoleManager(String root) ***REMOVED***
|
|
this.root = root;
|
|
***REMOVED***
|
|
|
|
public String getRoot() ***REMOVED***
|
|
return this.root;
|
|
***REMOVED***
|
|
|
|
public Role getRole(String roleName) throws NoSuchElementException ***REMOVED***
|
|
File f = new File(this.getRoot(), roleName);
|
|
try ***REMOVED***
|
|
return AnsibleSerializeHelper.deserializeRoleFromFilesystem(f);
|
|
***REMOVED*** catch (IOException e) ***REMOVED***
|
|
***REMOVED*** e.printStackTrace();
|
|
throw new NoSuchElementException("unable to find " + roleName);
|
|
***REMOVED***
|
|
***REMOVED***
|
|
|
|
***REMOVED***
|