mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 13:45:20 +00:00
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
@ -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…
Reference in New Issue
Block a user