update to first proxmox crate split
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
@ -4,8 +4,8 @@ use std::collections::HashMap;
|
||||
use anyhow::{Error, bail, format_err};
|
||||
use apt_pkg_native::Cache;
|
||||
|
||||
use proxmox::const_regex;
|
||||
use proxmox::tools::fs::{file_read_optional_string, replace_file, CreateOptions};
|
||||
use proxmox_schema::const_regex;
|
||||
|
||||
use pbs_api_types::APTUpdateInfo;
|
||||
|
||||
|
@ -6,7 +6,7 @@ use anyhow::{bail, format_err, Error};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::Value;
|
||||
|
||||
use proxmox::api::schema::{
|
||||
use proxmox_schema::{
|
||||
parse_property_string, parse_simple_value, verify_json_object, ObjectSchemaType, Schema,
|
||||
};
|
||||
|
||||
@ -152,7 +152,7 @@ fn object_to_writer(output: &mut dyn Write, object: &Object) -> Result<(), Error
|
||||
|
||||
#[test]
|
||||
fn test() {
|
||||
use proxmox::api::schema::ApiType;
|
||||
use proxmox_schema::ApiType;
|
||||
|
||||
// let's just reuse some schema we actually have available:
|
||||
use crate::config::node::NodeConfig;
|
||||
|
@ -17,7 +17,7 @@ use ::serde::{Deserialize, Serialize};
|
||||
use proxmox::sys::error::io_err_other;
|
||||
use proxmox::sys::linux::procfs::{MountInfo, mountinfo::Device};
|
||||
use proxmox::{io_bail, io_format_err};
|
||||
use proxmox::api::api;
|
||||
use proxmox_schema::api;
|
||||
|
||||
use pbs_api_types::{BLOCKDEVICE_NAME_REGEX, StorageStatus};
|
||||
|
||||
|
@ -4,7 +4,7 @@ use lazy_static::lazy_static;
|
||||
use anyhow::{bail, Error};
|
||||
use ::serde::{Deserialize, Serialize};
|
||||
|
||||
use proxmox::api::api;
|
||||
use proxmox_schema::api;
|
||||
|
||||
#[api()]
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
|
@ -34,7 +34,7 @@ use serde::Deserialize;
|
||||
/// where
|
||||
/// D: Deserializer<'de>,
|
||||
/// {
|
||||
/// let expire_before = proxmox::tools::time::epoch_i64() - CHALLENGE_TIMEOUT;
|
||||
/// let expire_before = proxmox_time::epoch_i64() - CHALLENGE_TIMEOUT;
|
||||
///
|
||||
/// Ok(deserializer.deserialize_seq(
|
||||
/// FilteredVecVisitor::new(
|
||||
|
@ -4,7 +4,7 @@ use regex::Regex;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::json;
|
||||
|
||||
use proxmox::api::api;
|
||||
use proxmox_schema::api;
|
||||
|
||||
use proxmox::tools::fs::{replace_file, CreateOptions};
|
||||
use proxmox_http::client::SimpleHttp;
|
||||
@ -229,7 +229,7 @@ fn test_parse_register_response() -> Result<(), Error> {
|
||||
/// queries the up to date subscription status and parses the response
|
||||
pub fn check_subscription(key: String, server_id: String) -> Result<SubscriptionInfo, Error> {
|
||||
|
||||
let now = proxmox::tools::time::epoch_i64();
|
||||
let now = proxmox_time::epoch_i64();
|
||||
|
||||
let (response, challenge) = pbs_runtime::block_on(register_subscription(&key, &server_id, now))
|
||||
.map_err(|err| format_err!("Error checking subscription: {}", err))?;
|
||||
@ -268,7 +268,7 @@ pub fn read_subscription() -> Result<Option<SubscriptionInfo>, Error> {
|
||||
}));
|
||||
}
|
||||
|
||||
let age = proxmox::tools::time::epoch_i64() - info.checktime.unwrap_or(0);
|
||||
let age = proxmox_time::epoch_i64() - info.checktime.unwrap_or(0);
|
||||
if age < -5400 { // allow some delta for DST changes or time syncs, 1.5h
|
||||
return Ok(Some( SubscriptionInfo {
|
||||
status: SubscriptionStatus::INVALID,
|
||||
|
@ -3,14 +3,8 @@ use lazy_static::lazy_static;
|
||||
|
||||
use super::types::*;
|
||||
|
||||
use proxmox::api::{
|
||||
schema::*,
|
||||
section_config::{
|
||||
SectionConfig,
|
||||
SectionConfigData,
|
||||
SectionConfigPlugin,
|
||||
}
|
||||
};
|
||||
use proxmox_schema::*;
|
||||
use proxmox_section_config::{SectionConfig, SectionConfigData, SectionConfigPlugin};
|
||||
|
||||
use proxmox::tools::{fs::replace_file, fs::CreateOptions};
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
use serde::{Serialize, Deserialize};
|
||||
|
||||
use proxmox::api::{ api, schema::* };
|
||||
use proxmox_schema::*;
|
||||
use pbs_api_types::SINGLE_LINE_COMMENT_FORMAT;
|
||||
|
||||
pub const SYSTEMD_SECTION_NAME_SCHEMA: Schema = StringSchema::new(
|
||||
|
Reference in New Issue
Block a user