Move the ExecutableTask to the root of zap-models
This commit is contained in:
parent
a3accf213a
commit
872157ce98
|
@ -10,8 +10,9 @@ mod transport;
|
|||
|
||||
use crate::inventory::*;
|
||||
use crate::transport::ssh::Ssh;
|
||||
use zap_model::plan::{ExecutableTask, Plan};
|
||||
use zap_model::plan::Plan;
|
||||
use zap_model::task::Task;
|
||||
use zap_model::ExecutableTask;
|
||||
|
||||
fn main() {
|
||||
pretty_env_logger::init();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use crate::inventory::{Group, Inventory, Target};
|
||||
use std::path::Path;
|
||||
use zap_model::plan::ExecutableTask;
|
||||
use zap_model::ExecutableTask;
|
||||
|
||||
pub mod ssh;
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ use std::io::BufReader;
|
|||
use std::net::TcpStream;
|
||||
use std::path::Path;
|
||||
|
||||
use zap_model::plan::ExecutableTask;
|
||||
use zap_model::ExecutableTask;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Ssh {
|
||||
|
|
|
@ -3,5 +3,23 @@ extern crate pest;
|
|||
#[macro_use]
|
||||
extern crate pest_derive;
|
||||
|
||||
use std::collections::HashMap;
|
||||
|
||||
pub mod plan;
|
||||
pub mod task;
|
||||
|
||||
/**
|
||||
* An ExecutableTask is a light container over a Task execpt with user-provided information and is
|
||||
* therefore ready for execution
|
||||
*/
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct ExecutableTask {
|
||||
pub task: task::Task,
|
||||
pub parameters: HashMap<String, String>,
|
||||
}
|
||||
|
||||
impl ExecutableTask {
|
||||
pub fn new(task: task::Task, parameters: HashMap<String, String>) -> Self {
|
||||
Self { task, parameters }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,22 +6,12 @@ use pest::Parser;
|
|||
use std::collections::HashMap;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use crate::ExecutableTask;
|
||||
|
||||
#[derive(Parser)]
|
||||
#[grammar = "plan.pest"]
|
||||
struct PlanParser;
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct ExecutableTask {
|
||||
pub task: crate::task::Task,
|
||||
pub parameters: HashMap<String, String>,
|
||||
}
|
||||
|
||||
impl ExecutableTask {
|
||||
pub fn new(task: crate::task::Task, parameters: HashMap<String, String>) -> Self {
|
||||
Self { task, parameters }
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Plan {
|
||||
pub tasks: Vec<ExecutableTask>,
|
||||
|
|
Loading…
Reference in New Issue