From 9d21ec4bbae1e5b855b51c7f310bc2d42525fec0 Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Mon, 8 Jul 2024 13:36:08 -0300 Subject: [PATCH] chore: upgrade dependency from yang2 to yang3 Signed-off-by: Renato Westphal --- Cargo.toml | 2 +- INSTALL.md | 2 +- holo-bfd/Cargo.toml | 2 +- holo-bgp/Cargo.toml | 2 +- holo-bgp/src/northbound/rpc.rs | 2 +- holo-daemon/Cargo.toml | 2 +- holo-daemon/src/northbound/client/api.rs | 2 +- holo-daemon/src/northbound/client/gnmi.rs | 4 ++-- holo-daemon/src/northbound/client/grpc.rs | 2 +- holo-daemon/src/northbound/core.rs | 2 +- holo-daemon/src/northbound/error.rs | 6 +++--- holo-interface/Cargo.toml | 2 +- holo-keychain/Cargo.toml | 2 +- holo-ldp/Cargo.toml | 2 +- holo-ldp/src/northbound/rpc.rs | 2 +- holo-northbound/Cargo.toml | 4 ++-- holo-northbound/build.rs | 6 +++--- holo-northbound/src/api.rs | 2 +- holo-northbound/src/configuration.rs | 4 ++-- holo-northbound/src/error.rs | 4 ++-- holo-northbound/src/lib.rs | 2 +- holo-northbound/src/notification.rs | 2 +- holo-northbound/src/rpc.rs | 4 ++-- holo-northbound/src/state.rs | 4 ++-- holo-ospf/Cargo.toml | 2 +- holo-ospf/src/northbound/configuration.rs | 2 +- holo-ospf/src/northbound/rpc.rs | 2 +- holo-policy/Cargo.toml | 2 +- holo-protocol/Cargo.toml | 2 +- holo-protocol/src/test/stub/collector.rs | 2 +- holo-protocol/src/test/stub/northbound.rs | 2 +- holo-rip/Cargo.toml | 2 +- holo-routing/Cargo.toml | 2 +- holo-routing/src/northbound/rpc.rs | 2 +- holo-tools/Cargo.toml | 2 +- holo-tools/src/yang_callbacks.rs | 4 ++-- holo-tools/src/yang_coverage.rs | 4 ++-- holo-tools/src/yang_deviations.rs | 2 +- holo-utils/Cargo.toml | 2 +- holo-utils/src/yang.rs | 6 +++--- holo-yang/Cargo.toml | 2 +- holo-yang/src/lib.rs | 4 ++-- holo-yang/src/serde/data_tree.rs | 2 +- 43 files changed, 58 insertions(+), 58 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2a33e877..0c2e5def 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -73,7 +73,7 @@ tonic = { version = "0.11", features = ["tls"] } tonic-build = "0.11" tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] } -yang2 = { version = "0.13", features = ["bundled"] } +yang3 = { version = "0.1", features = ["bundled"] } [workspace.lints.rust] rust_2018_idioms = { level = "warn", priority = -1 } diff --git a/INSTALL.md b/INSTALL.md index 52cb51e3..cbf452ea 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -17,7 +17,7 @@ $ git clone https://github.com/holo-routing/holo-cli.git 3. Install build dependencies: -Holo requires a few dependencies for building and embedding the libyang2 library. +Holo requires a few dependencies for building and embedding the libyang library. You can install them using your system's package manager. For example, on Debian-based systems: ``` diff --git a/holo-bfd/Cargo.toml b/holo-bfd/Cargo.toml index ab69ffe9..20318258 100644 --- a/holo-bfd/Cargo.toml +++ b/holo-bfd/Cargo.toml @@ -25,7 +25,7 @@ serde_json.workspace = true socket2.workspace = true tokio.workspace = true tracing.workspace = true -yang2.workspace = true +yang3.workspace = true holo-northbound = { path = "../holo-northbound" } holo-protocol = { path = "../holo-protocol" } diff --git a/holo-bgp/Cargo.toml b/holo-bgp/Cargo.toml index 3ed58b4e..8532bff3 100644 --- a/holo-bgp/Cargo.toml +++ b/holo-bgp/Cargo.toml @@ -26,7 +26,7 @@ serde_json.workspace = true serde_with.workspace = true tokio.workspace = true tracing.workspace = true -yang2.workspace = true +yang3.workspace = true holo-northbound = { path = "../holo-northbound" } holo-protocol = { path = "../holo-protocol" } diff --git a/holo-bgp/src/northbound/rpc.rs b/holo-bgp/src/northbound/rpc.rs index d92ca4ff..f05988fc 100644 --- a/holo-bgp/src/northbound/rpc.rs +++ b/holo-bgp/src/northbound/rpc.rs @@ -9,7 +9,7 @@ use std::sync::LazyLock as Lazy; use holo_northbound::rpc::{Callbacks, CallbacksBuilder, Provider}; use holo_northbound::yang::control_plane_protocol::bgp; use holo_utils::yang::DataNodeRefExt; -use yang2::data::Data; +use yang3::data::Data; use crate::instance::Instance; diff --git a/holo-daemon/Cargo.toml b/holo-daemon/Cargo.toml index 43a42c3d..b49adc4b 100644 --- a/holo-daemon/Cargo.toml +++ b/holo-daemon/Cargo.toml @@ -28,7 +28,7 @@ tokio.workspace = true tonic.workspace = true tracing.workspace = true tracing-subscriber.workspace = true -yang2.workspace = true +yang3.workspace = true holo-interface = { path = "../holo-interface", optional = true } holo-bfd = { path = "../holo-bfd", optional = true } diff --git a/holo-daemon/src/northbound/client/api.rs b/holo-daemon/src/northbound/client/api.rs index f0a41bfc..99453ef5 100644 --- a/holo-daemon/src/northbound/client/api.rs +++ b/holo-daemon/src/northbound/client/api.rs @@ -5,7 +5,7 @@ // use holo_utils::Responder; -use yang2::data::{DataDiff, DataTree}; +use yang3::data::{DataDiff, DataTree}; use crate::northbound::core::Transaction; use crate::northbound::Result; diff --git a/holo-daemon/src/northbound/client/gnmi.rs b/holo-daemon/src/northbound/client/gnmi.rs index e4689fe1..f2f31cb5 100644 --- a/holo-daemon/src/northbound/client/gnmi.rs +++ b/holo-daemon/src/northbound/client/gnmi.rs @@ -14,8 +14,8 @@ use tokio_stream::wrappers::ReceiverStream; use tonic::transport::{Server, ServerTlsConfig}; use tonic::{Request, Response, Status, Streaming}; use tracing::{debug, debug_span, error, trace}; -use yang2::data::{Data, DataFormat, DataPrinterFlags, DataTree}; -use yang2::schema::SchemaNodeKind; +use yang3::data::{Data, DataFormat, DataPrinterFlags, DataTree}; +use yang3::schema::SchemaNodeKind; use crate::config; use crate::northbound::client::api; diff --git a/holo-daemon/src/northbound/client/grpc.rs b/holo-daemon/src/northbound/client/grpc.rs index d67b6fee..8fc118e2 100644 --- a/holo-daemon/src/northbound/client/grpc.rs +++ b/holo-daemon/src/northbound/client/grpc.rs @@ -14,7 +14,7 @@ use tokio::sync::oneshot; use tonic::transport::{Server, ServerTlsConfig}; use tonic::{Request, Response, Status}; use tracing::{debug, debug_span, error, trace}; -use yang2::data::{ +use yang3::data::{ Data, DataDiff, DataFormat, DataOperation, DataParserFlags, DataPrinterFlags, DataTree, DataValidationFlags, }; diff --git a/holo-daemon/src/northbound/core.rs b/holo-daemon/src/northbound/core.rs index 23c8546c..228b3ae1 100644 --- a/holo-daemon/src/northbound/core.rs +++ b/holo-daemon/src/northbound/core.rs @@ -24,7 +24,7 @@ use pickledb::PickleDb; use serde::{Deserialize, Serialize}; use tokio::sync::{broadcast, mpsc, oneshot}; use tracing::{debug, error, info, instrument, trace, warn}; -use yang2::data::{ +use yang3::data::{ Data, DataDiffFlags, DataFormat, DataPrinterFlags, DataTree, DataValidationFlags, }; diff --git a/holo-daemon/src/northbound/error.rs b/holo-daemon/src/northbound/error.rs index b0d5cefd..8d85db40 100644 --- a/holo-daemon/src/northbound/error.rs +++ b/holo-daemon/src/northbound/error.rs @@ -16,9 +16,9 @@ pub type Result = std::result::Result; // #[derive(Debug)] pub enum Error { - YangInvalidPath(yang2::Error), - YangInvalidData(yang2::Error), - YangInternal(yang2::Error), + YangInvalidPath(yang3::Error), + YangInvalidData(yang3::Error), + YangInternal(yang3::Error), TransactionValidation(northbound::error::Error), TransactionPreparation(northbound::error::Error), TransactionIdNotFound(u32), diff --git a/holo-interface/Cargo.toml b/holo-interface/Cargo.toml index 46509c10..a5bddb87 100644 --- a/holo-interface/Cargo.toml +++ b/holo-interface/Cargo.toml @@ -20,7 +20,7 @@ netlink-sys.workspace = true rtnetlink.workspace = true tokio.workspace = true tracing.workspace = true -yang2.workspace = true +yang3.workspace = true holo-northbound = { path = "../holo-northbound" } holo-utils = { path = "../holo-utils" } diff --git a/holo-keychain/Cargo.toml b/holo-keychain/Cargo.toml index a89a8e53..770dad1c 100644 --- a/holo-keychain/Cargo.toml +++ b/holo-keychain/Cargo.toml @@ -12,7 +12,7 @@ derive-new.workspace = true enum-as-inner.workspace = true tokio.workspace = true tracing.workspace = true -yang2.workspace = true +yang3.workspace = true holo-northbound = { path = "../holo-northbound" } holo-utils = { path = "../holo-utils" } diff --git a/holo-ldp/Cargo.toml b/holo-ldp/Cargo.toml index 989f91e4..d8e032c2 100644 --- a/holo-ldp/Cargo.toml +++ b/holo-ldp/Cargo.toml @@ -24,7 +24,7 @@ serde_with.workspace = true socket2.workspace = true tokio.workspace = true tracing.workspace = true -yang2.workspace = true +yang3.workspace = true holo-northbound = { path = "../holo-northbound" } holo-protocol = { path = "../holo-protocol" } diff --git a/holo-ldp/src/northbound/rpc.rs b/holo-ldp/src/northbound/rpc.rs index 2076ffea..25326ebd 100644 --- a/holo-ldp/src/northbound/rpc.rs +++ b/holo-ldp/src/northbound/rpc.rs @@ -10,7 +10,7 @@ use std::sync::LazyLock as Lazy; use holo_northbound::rpc::{Callbacks, CallbacksBuilder, Provider}; use holo_northbound::yang; use holo_utils::yang::DataNodeRefExt; -use yang2::data::Data; +use yang3::data::Data; use crate::discovery; use crate::instance::{Instance, InstanceUpView}; diff --git a/holo-northbound/Cargo.toml b/holo-northbound/Cargo.toml index 2cec32d9..18760f31 100644 --- a/holo-northbound/Cargo.toml +++ b/holo-northbound/Cargo.toml @@ -17,7 +17,7 @@ serde.workspace = true serde_json.workspace = true tokio.workspace = true tracing.workspace = true -yang2.workspace = true +yang3.workspace = true holo-utils = { path = "../holo-utils" } holo-yang = { path = "../holo-yang" } @@ -28,7 +28,7 @@ holo-utils = { path = "../holo-utils" } [build-dependencies] check_keyword.workspace = true convert_case.workspace = true -yang2.workspace = true +yang3.workspace = true holo-yang = { path = "../holo-yang" } [lints] diff --git a/holo-northbound/build.rs b/holo-northbound/build.rs index 0a99d620..d349b8d5 100644 --- a/holo-northbound/build.rs +++ b/holo-northbound/build.rs @@ -14,7 +14,7 @@ use check_keyword::CheckKeyword; use convert_case::{Boundary, Case, Casing}; use holo_yang as yang; use holo_yang::YANG_IMPLEMENTED_MODULES; -use yang2::schema::{ +use yang3::schema::{ DataValue, DataValueType, SchemaLeafType, SchemaNode, SchemaNodeKind, SchemaPathFormat, }; @@ -28,8 +28,8 @@ use chrono::{DateTime, Utc}; use holo_yang::{YangObject, YangPath, YANG_CTX}; use ipnetwork::{IpNetwork, Ipv4Network, Ipv6Network}; use itertools::Itertools; -use yang2::data::DataNodeRef; -use yang2::schema::SchemaModule; +use yang3::data::DataNodeRef; +use yang3::schema::SchemaModule; fn binary_to_yang(value: &[u8]) -> String { use base64::Engine; diff --git a/holo-northbound/src/api.rs b/holo-northbound/src/api.rs index 625d717f..d02c7903 100644 --- a/holo-northbound/src/api.rs +++ b/holo-northbound/src/api.rs @@ -9,7 +9,7 @@ use std::sync::Arc; use holo_utils::Responder; use serde::{Deserialize, Serialize}; -use yang2::data::DataTree; +use yang3::data::DataTree; use crate::configuration::{CommitPhase, ConfigChanges}; use crate::error::Error; diff --git a/holo-northbound/src/configuration.rs b/holo-northbound/src/configuration.rs index c4736860..4bddd0e6 100644 --- a/holo-northbound/src/configuration.rs +++ b/holo-northbound/src/configuration.rs @@ -12,8 +12,8 @@ use holo_utils::yang::SchemaNodeExt; use holo_yang::YangPath; use serde::{Deserialize, Serialize}; use tokio::sync::oneshot; -use yang2::data::{Data, DataDiff, DataDiffOp, DataNodeRef, DataTree}; -use yang2::schema::SchemaNodeKind; +use yang3::data::{Data, DataDiff, DataDiffOp, DataNodeRef, DataTree}; +use yang3::schema::SchemaNodeKind; use crate::debug::Debug; use crate::error::Error; diff --git a/holo-northbound/src/error.rs b/holo-northbound/src/error.rs index a49fc87f..0dfaf36d 100644 --- a/holo-northbound/src/error.rs +++ b/holo-northbound/src/error.rs @@ -14,8 +14,8 @@ pub enum Error { RpcNotFound, RpcRelay(String), RpcCallback(String), - YangInvalidPath(yang2::Error), - YangInvalidData(yang2::Error), + YangInvalidPath(yang3::Error), + YangInvalidData(yang3::Error), } // ===== impl Error ===== diff --git a/holo-northbound/src/lib.rs b/holo-northbound/src/lib.rs index b85af914..822f5b52 100644 --- a/holo-northbound/src/lib.rs +++ b/holo-northbound/src/lib.rs @@ -24,7 +24,7 @@ use derive_new::new; use holo_utils::{Receiver, Sender, UnboundedReceiver, UnboundedSender}; use serde::{Deserialize, Serialize}; use tracing::Span; -use yang2::schema::{DataValueType, SchemaNode, SchemaNodeKind}; +use yang3::schema::{DataValueType, SchemaNode, SchemaNodeKind}; use crate::debug::Debug; diff --git a/holo-northbound/src/notification.rs b/holo-northbound/src/notification.rs index 90a427ec..e7363245 100644 --- a/holo-northbound/src/notification.rs +++ b/holo-northbound/src/notification.rs @@ -5,7 +5,7 @@ // use holo_yang::{YangObject, YANG_CTX}; -use yang2::data::DataTree; +use yang3::data::DataTree; use crate::api::provider::Notification; use crate::NbProviderSender; diff --git a/holo-northbound/src/rpc.rs b/holo-northbound/src/rpc.rs index f2919eb3..61fffd30 100644 --- a/holo-northbound/src/rpc.rs +++ b/holo-northbound/src/rpc.rs @@ -11,8 +11,8 @@ use std::pin::Pin; use holo_utils::yang::SchemaNodeExt; use holo_yang::YangPath; use tokio::sync::oneshot; -use yang2::data::{DataNodeRef, DataTree}; -use yang2::schema::SchemaNodeKind; +use yang3::data::{DataNodeRef, DataTree}; +use yang3::schema::SchemaNodeKind; use crate::debug::Debug; use crate::error::Error; diff --git a/holo-northbound/src/state.rs b/holo-northbound/src/state.rs index eb75a57b..29af0947 100644 --- a/holo-northbound/src/state.rs +++ b/holo-northbound/src/state.rs @@ -11,8 +11,8 @@ use derive_new::new; use holo_utils::yang::SchemaNodeExt; use holo_yang::{YangObject, YangPath, YANG_CTX}; use tokio::sync::oneshot; -use yang2::data::{DataNodeRef, DataTree}; -use yang2::schema::{SchemaModule, SchemaNode, SchemaNodeKind}; +use yang3::data::{DataNodeRef, DataTree}; +use yang3::schema::{SchemaModule, SchemaNode, SchemaNodeKind}; use crate::error::Error; use crate::{api, CallbackKey, CallbackOp, NbDaemonSender, ProviderBase}; diff --git a/holo-ospf/Cargo.toml b/holo-ospf/Cargo.toml index 08579d34..21569b02 100644 --- a/holo-ospf/Cargo.toml +++ b/holo-ospf/Cargo.toml @@ -33,7 +33,7 @@ smallvec.workspace = true socket2.workspace = true tokio.workspace = true tracing.workspace = true -yang2.workspace = true +yang3.workspace = true holo-northbound = { path = "../holo-northbound" } holo-protocol = { path = "../holo-protocol" } diff --git a/holo-ospf/src/northbound/configuration.rs b/holo-ospf/src/northbound/configuration.rs index 06cca84e..641e05b3 100644 --- a/holo-ospf/src/northbound/configuration.rs +++ b/holo-ospf/src/northbound/configuration.rs @@ -21,7 +21,7 @@ use holo_utils::ibus::IbusMsg; use holo_utils::ip::{AddressFamily, IpAddrKind, IpNetworkKind}; use holo_utils::yang::DataNodeRefExt; use holo_yang::{ToYang, TryFromYang}; -use yang2::data::Data; +use yang3::data::Data; use crate::area::{self, AreaType}; use crate::collections::{AreaIndex, InterfaceIndex}; diff --git a/holo-ospf/src/northbound/rpc.rs b/holo-ospf/src/northbound/rpc.rs index 9c50f882..b5ff5a61 100644 --- a/holo-ospf/src/northbound/rpc.rs +++ b/holo-ospf/src/northbound/rpc.rs @@ -9,7 +9,7 @@ use std::sync::LazyLock as Lazy; use holo_northbound::rpc::{Callbacks, CallbacksBuilder, Provider}; use holo_northbound::yang; use holo_utils::yang::DataNodeRefExt; -use yang2::data::Data; +use yang3::data::Data; use crate::instance::{Instance, InstanceArenas, InstanceUpView}; use crate::neighbor::nsm; diff --git a/holo-policy/Cargo.toml b/holo-policy/Cargo.toml index cda5c469..71385e1c 100644 --- a/holo-policy/Cargo.toml +++ b/holo-policy/Cargo.toml @@ -11,7 +11,7 @@ derive-new.workspace = true enum-as-inner.workspace = true tokio.workspace = true tracing.workspace = true -yang2.workspace = true +yang3.workspace = true holo-northbound = { path = "../holo-northbound" } holo-utils = { path = "../holo-utils" } diff --git a/holo-protocol/Cargo.toml b/holo-protocol/Cargo.toml index 395e07f5..2dff9b45 100644 --- a/holo-protocol/Cargo.toml +++ b/holo-protocol/Cargo.toml @@ -13,7 +13,7 @@ serde_json.workspace = true tokio.workspace = true tracing.workspace = true tracing-subscriber.workspace = true -yang2.workspace = true +yang3.workspace = true holo-northbound = { path = "../holo-northbound" } holo-utils = { path = "../holo-utils" } diff --git a/holo-protocol/src/test/stub/collector.rs b/holo-protocol/src/test/stub/collector.rs index dc01bbc1..0b3224d5 100644 --- a/holo-protocol/src/test/stub/collector.rs +++ b/holo-protocol/src/test/stub/collector.rs @@ -9,7 +9,7 @@ use std::sync::{Arc, Mutex}; use holo_northbound::NbProviderReceiver; use holo_utils::ibus::IbusReceiver; use holo_utils::Receiver; -use yang2::data::{Data, DataFormat, DataPrinterFlags}; +use yang3::data::{Data, DataFormat, DataPrinterFlags}; use crate::ProtocolInstance; diff --git a/holo-protocol/src/test/stub/northbound.rs b/holo-protocol/src/test/stub/northbound.rs index fc31793f..3ae8b1e1 100644 --- a/holo-protocol/src/test/stub/northbound.rs +++ b/holo-protocol/src/test/stub/northbound.rs @@ -10,7 +10,7 @@ use holo_northbound::configuration::{self, CommitPhase, ConfigChanges}; use holo_northbound::{api, NbDaemonSender}; use holo_yang::YANG_CTX; use tokio::sync::oneshot; -use yang2::data::{ +use yang3::data::{ Data, DataDiff, DataDiffFlags, DataFormat, DataOperation, DataParserFlags, DataPrinterFlags, DataTree, DataValidationFlags, }; diff --git a/holo-rip/Cargo.toml b/holo-rip/Cargo.toml index ca115a5d..b537a276 100644 --- a/holo-rip/Cargo.toml +++ b/holo-rip/Cargo.toml @@ -24,7 +24,7 @@ serde.workspace = true serde_json.workspace = true tokio.workspace = true tracing.workspace = true -yang2.workspace = true +yang3.workspace = true holo-northbound = { path = "../holo-northbound" } holo-protocol = { path = "../holo-protocol" } diff --git a/holo-routing/Cargo.toml b/holo-routing/Cargo.toml index 7b560c1f..d0dbfc89 100644 --- a/holo-routing/Cargo.toml +++ b/holo-routing/Cargo.toml @@ -19,7 +19,7 @@ regex.workspace = true rtnetlink.workspace = true tokio.workspace = true tracing.workspace = true -yang2.workspace = true +yang3.workspace = true holo-northbound = { path = "../holo-northbound" } holo-protocol = { path = "../holo-protocol" } diff --git a/holo-routing/src/northbound/rpc.rs b/holo-routing/src/northbound/rpc.rs index f281c4ee..b4ea1c96 100644 --- a/holo-routing/src/northbound/rpc.rs +++ b/holo-routing/src/northbound/rpc.rs @@ -9,7 +9,7 @@ use holo_northbound::yang::control_plane_protocol; use holo_northbound::{CallbackKey, NbDaemonSender}; use holo_utils::protocol::Protocol; use holo_utils::yang::DataNodeRefExt; -use yang2::data::DataNodeRef; +use yang3::data::DataNodeRef; use crate::Master; diff --git a/holo-tools/Cargo.toml b/holo-tools/Cargo.toml index 5045752b..d700a3e4 100644 --- a/holo-tools/Cargo.toml +++ b/holo-tools/Cargo.toml @@ -13,7 +13,7 @@ num-traits.workspace = true serde_json.workspace = true similar.workspace = true tokio.workspace = true -yang2.workspace = true +yang3.workspace = true holo-bfd = { path = "../holo-bfd", features = ["testing"] } holo-bgp = { path = "../holo-bgp", features = ["testing"] } diff --git a/holo-tools/src/yang_callbacks.rs b/holo-tools/src/yang_callbacks.rs index 8c457db5..915a5cd5 100644 --- a/holo-tools/src/yang_callbacks.rs +++ b/holo-tools/src/yang_callbacks.rs @@ -9,8 +9,8 @@ use clap::{App, Arg}; use convert_case::{Boundary, Case, Casing}; use holo_northbound::CallbackOp; use holo_yang as yang; -use yang2::context::Context; -use yang2::schema::{SchemaModule, SchemaNode, SchemaNodeKind}; +use yang3::context::Context; +use yang3::schema::{SchemaModule, SchemaNode, SchemaNodeKind}; fn snode_module(snode: &SchemaNode<'_>) -> String { let snodes = snode.inclusive_ancestors().collect::>(); diff --git a/holo-tools/src/yang_coverage.rs b/holo-tools/src/yang_coverage.rs index c64e86e5..cdd66db8 100644 --- a/holo-tools/src/yang_coverage.rs +++ b/holo-tools/src/yang_coverage.rs @@ -9,8 +9,8 @@ use std::collections::BTreeMap; use clap::{App, Arg}; use holo_yang as yang; use num_traits::cast::AsPrimitive; -use yang2::context::Context; -use yang2::schema::{SchemaNodeKind, SchemaOutputFormat, SchemaPrinterFlags}; +use yang3::context::Context; +use yang3::schema::{SchemaNodeKind, SchemaOutputFormat, SchemaPrinterFlags}; #[derive(Debug, Default)] struct NodeCounters { diff --git a/holo-tools/src/yang_deviations.rs b/holo-tools/src/yang_deviations.rs index 9a86b90c..55bfc5a3 100644 --- a/holo-tools/src/yang_deviations.rs +++ b/holo-tools/src/yang_deviations.rs @@ -6,7 +6,7 @@ use clap::{App, Arg}; use holo_yang as yang; -use yang2::schema::SchemaNode; +use yang3::schema::SchemaNode; // Generate fully-prefixed schema path. fn gen_fully_prefixed_path(snode: &SchemaNode<'_>) -> String { diff --git a/holo-utils/Cargo.toml b/holo-utils/Cargo.toml index 514d22c9..9a9f71ab 100644 --- a/holo-utils/Cargo.toml +++ b/holo-utils/Cargo.toml @@ -28,7 +28,7 @@ serde_json.workspace = true socket2.workspace = true tokio.workspace = true tracing.workspace = true -yang2.workspace = true +yang3.workspace = true holo-yang = { path = "../holo-yang" } diff --git a/holo-utils/src/yang.rs b/holo-utils/src/yang.rs index a174260d..fc6b30a2 100644 --- a/holo-utils/src/yang.rs +++ b/holo-utils/src/yang.rs @@ -10,9 +10,9 @@ use std::str::FromStr; use holo_yang::TryFromYang; use ipnetwork::{IpNetwork, Ipv4Network, Ipv6Network}; -use yang2::context::Context; -use yang2::data::{Data, DataNodeRef}; -use yang2::schema::{DataValue, SchemaNode, SchemaPathFormat}; +use yang3::context::Context; +use yang3::data::{Data, DataNodeRef}; +use yang3::schema::{DataValue, SchemaNode, SchemaPathFormat}; use crate::ip::AddressFamily; diff --git a/holo-yang/Cargo.toml b/holo-yang/Cargo.toml index fdeef09b..7c6f5cb7 100644 --- a/holo-yang/Cargo.toml +++ b/holo-yang/Cargo.toml @@ -11,7 +11,7 @@ description = "YANG module of Holo Routing, including embedded YANG models and u maplit.workspace = true serde.workspace = true tracing.workspace = true -yang2.workspace = true +yang3.workspace = true [lints] workspace = true diff --git a/holo-yang/src/lib.rs b/holo-yang/src/lib.rs index e21e1338..7e1d1a92 100644 --- a/holo-yang/src/lib.rs +++ b/holo-yang/src/lib.rs @@ -11,10 +11,10 @@ use std::collections::HashMap; use std::sync::{Arc, LazyLock as Lazy, OnceLock}; use maplit::hashmap; -use yang2::context::{ +use yang3::context::{ Context, ContextFlags, EmbeddedModuleKey, EmbeddedModules, }; -use yang2::data::DataNodeRef; +use yang3::data::DataNodeRef; // Global YANG context. pub static YANG_CTX: OnceLock> = OnceLock::new(); diff --git a/holo-yang/src/serde/data_tree.rs b/holo-yang/src/serde/data_tree.rs index 671a6fe8..3402abc7 100644 --- a/holo-yang/src/serde/data_tree.rs +++ b/holo-yang/src/serde/data_tree.rs @@ -7,7 +7,7 @@ use std::sync::Arc; use serde::{Deserialize, Serializer}; -use yang2::data::{ +use yang3::data::{ Data, DataFormat, DataParserFlags, DataPrinterFlags, DataTree, DataValidationFlags, };