ch-remote: Simplify ch-remote create from config file
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
216f330f4e
commit
46bbe0e612
1 changed files with 2 additions and 3 deletions
|
|
@ -321,9 +321,8 @@ fn create_api_command(socket: &mut UnixStream, path: &str) -> Result<(), Error>
|
|||
.read_to_string(&mut data)
|
||||
.map_err(Error::ReadingStdin)?;
|
||||
} else {
|
||||
let mut f = std::fs::File::open(path).map_err(Error::ReadingFile)?;
|
||||
f.read_to_string(&mut data).map_err(Error::ReadingFile)?;
|
||||
};
|
||||
data = std::fs::read_to_string(path).map_err(Error::ReadingFile)?;
|
||||
}
|
||||
|
||||
simple_api_command(socket, "PUT", "create", Some(&data)).map_err(Error::ApiClient)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue