This commit is contained in:
Adrian Heine 2017-05-19 18:15:16 +02:00
parent dac3db10c8
commit eadd5f5b07
24 changed files with 108 additions and 193 deletions

View file

@ -95,14 +95,11 @@ impl<'a, E: Error, A: UserAdder<SubE=E>> fmt::Display for User<'a, E, A> {
impl<'a, E: 'static + Error, A: UserAdder<SubE=E>> Symbol for User<'a, E, A> {
fn target_reached(&self) -> Result<bool, Box<Error>> {
let output = self.command_runner.run_with_args("getent", &["passwd", &*self.user_name]);
match output {
Ok(output) => match output.status.code() {
Some(2) => Ok(false),
Some(0) => Ok(true),
_ => Err(Box::new(UserError::GenericError))
},
Err(e) => Err(Box::new(e))
let output = try!(self.command_runner.run_with_args("getent", &["passwd", &*self.user_name]));
match output.status.code() {
Some(2) => Ok(false),
Some(0) => Ok(true),
_ => Err(Box::new(UserError::GenericError))
}
}