pub fn template_configs(&mut self, reg: &Region) -> Result<()> {
        let ctx = self.make_template_context(reg)?;
        if let Some(ref mut cfg) = self.configs {
            for f in &mut cfg.files {
                if let Some(ref mut v) = f.value {
                    let data: String = v.clone();
                    let svc = self.name.clone();
                    *v = render_file_data(data, &ctx).chain_err(|| ErrorKind::InvalidTemplate(svc))?;
                } else {
                    bail!("configs must be read first - missing {}", f.name); // internal error
                }
            }
        }
        Ok(())
    }
/// Replace template in values with template result inplace
Replace template in values with template result inplace
Replace template in values with template result inplace
pub fn template_configs(&mut self, reg: &Region) -> Result<()> {
        let ctx = self.make_template_context(reg)?;
        if let Some(ref mut cfg) = self.configs {
            for f in &mut cfg.files {
                if let Some(ref mut v) = f.value {
                    let data: String = v.clone();
                    let svc = self.name.clone();
                    *v = render_file_data(data, &ctx).chain_err(|| ErrorKind::InvalidTemplate(svc))?;
                } else {
                    bail!("configs must be read first - missing {}", f.name); // internal error
                }
            }
        }
        Ok(())
    }
pub fn template_configs ( & mut self , reg : & Region ) -> Result < ( ) > { let ctx = self . make_template_context ( reg ) ? ; if let Some ( ref mut cfg ) = self . configs { for f in & mut cfg . files { if let Some ( ref mut v ) = f . value { let data : String = v . clone ( ) ; let svc = self . name . clone ( ) ; * v = render_file_data ( data , & ctx ) . chain_err ( | | ErrorKind :: InvalidTemplate ( svc ) ) ? ; } else { bail ! ( " " f name ) ; // internal error } } } Ok ( ( ) ) }
Replace template in values with template result inplace
Replace template in values with template result inplace
&mut self
reg
&Region
&mut self
reg
&Region