use of de.cinovo.cloudconductor.api.model.Repo in project cloudconductor-agent-redhat by cinovo.
the class RepoHandler method run.
/**
* @throws ExecutionError an error occurred during the execution
*/
public void run() throws ExecutionError {
RepoHandler.LOGGER.debug("Start RepoHandler");
Set<Repo> repos;
try {
repos = ServerCom.getRepos();
} catch (CloudConductorException e) {
throw new ExecutionError("Error getting repositories for template: ", e);
}
RepoHandler.LOGGER.debug("Update " + repos.size() + " yum repos...");
Set<String> repoNames = new HashSet<>();
for (Repo repo : repos) {
try {
repoNames.add(repo.getName());
FileHelper.writeYumRepo(repo);
} catch (IOException e) {
throw new ExecutionError("Error writing yum repo for '" + repo.getName() + "': ", e);
}
}
AgentState.info().setRepos(repoNames);
RepoHandler.LOGGER.debug("Finished RepoHandler");
}
Aggregations