cleanup schema function calls
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
@ -4,7 +4,7 @@ use serde_json::Value;
|
||||
use hex::FromHex;
|
||||
|
||||
use proxmox_router::{Router, RpcEnvironment, Permission};
|
||||
use proxmox_schema::{api, parse_property_string};
|
||||
use proxmox_schema::api;
|
||||
|
||||
use pbs_api_types::{
|
||||
Authid, ScsiTapeChanger, ScsiTapeChangerUpdater, LtoTapeDrive,
|
||||
@ -205,9 +205,7 @@ pub fn update_changer(
|
||||
}
|
||||
|
||||
if let Some(export_slots) = update.export_slots {
|
||||
let slots: Value = parse_property_string(
|
||||
&export_slots, &SLOT_ARRAY_SCHEMA
|
||||
)?;
|
||||
let slots: Value = SLOT_ARRAY_SCHEMA.parse_property_string(&export_slots)?;
|
||||
let mut slots: Vec<String> = slots
|
||||
.as_array()
|
||||
.unwrap()
|
||||
|
@ -6,7 +6,7 @@ use ::serde::{Deserialize, Serialize};
|
||||
use hex::FromHex;
|
||||
|
||||
use proxmox_router::{Router, RpcEnvironment, RpcEnvironmentType, Permission};
|
||||
use proxmox_schema::{api, ApiType, parse_property_string};
|
||||
use proxmox_schema::{api, ApiType};
|
||||
use proxmox_section_config::SectionConfigData;
|
||||
use proxmox_sys::WorkerTaskContext;
|
||||
|
||||
@ -283,7 +283,7 @@ pub fn update_datastore(
|
||||
if update.keep_yearly.is_some() { data.keep_yearly = update.keep_yearly; }
|
||||
|
||||
if let Some(notify_str) = update.notify {
|
||||
let value = parse_property_string(¬ify_str, &DatastoreNotify::API_SCHEMA)?;
|
||||
let value = DatastoreNotify::API_SCHEMA.parse_property_string(¬ify_str)?;
|
||||
let notify: DatastoreNotify = serde_json::from_value(value)?;
|
||||
if let DatastoreNotify { gc: None, verify: None, sync: None } = notify {
|
||||
data.notify = None;
|
||||
|
Reference in New Issue
Block a user