Skip to content

Commit

Permalink
chore: upgrade dependency from yang2 to yang3
Browse files Browse the repository at this point in the history
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
  • Loading branch information
rwestphal committed Jul 8, 2024
1 parent dd3523f commit 9d21ec4
Show file tree
Hide file tree
Showing 43 changed files with 58 additions and 58 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

```
Expand Down
2 changes: 1 addition & 1 deletion holo-bfd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
2 changes: 1 addition & 1 deletion holo-bgp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
2 changes: 1 addition & 1 deletion holo-bgp/src/northbound/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion holo-daemon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion holo-daemon/src/northbound/client/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions holo-daemon/src/northbound/client/gnmi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion holo-daemon/src/northbound/client/grpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion holo-daemon/src/northbound/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
6 changes: 3 additions & 3 deletions holo-daemon/src/northbound/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ pub type Result<T> = std::result::Result<T, Error>;
//
#[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),
Expand Down
2 changes: 1 addition & 1 deletion holo-interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
2 changes: 1 addition & 1 deletion holo-keychain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
2 changes: 1 addition & 1 deletion holo-ldp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
2 changes: 1 addition & 1 deletion holo-ldp/src/northbound/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
4 changes: 2 additions & 2 deletions holo-northbound/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand All @@ -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]
Expand Down
6 changes: 3 additions & 3 deletions holo-northbound/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion holo-northbound/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions holo-northbound/src/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions holo-northbound/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 =====
Expand Down
2 changes: 1 addition & 1 deletion holo-northbound/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion holo-northbound/src/notification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions holo-northbound/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions holo-northbound/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
2 changes: 1 addition & 1 deletion holo-ospf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
2 changes: 1 addition & 1 deletion holo-ospf/src/northbound/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
2 changes: 1 addition & 1 deletion holo-ospf/src/northbound/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion holo-policy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
2 changes: 1 addition & 1 deletion holo-protocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
2 changes: 1 addition & 1 deletion holo-protocol/src/test/stub/collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion holo-protocol/src/test/stub/northbound.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion holo-rip/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
2 changes: 1 addition & 1 deletion holo-routing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
2 changes: 1 addition & 1 deletion holo-routing/src/northbound/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion holo-tools/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
4 changes: 2 additions & 2 deletions holo-tools/src/yang_callbacks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Vec<_>>();
Expand Down
4 changes: 2 additions & 2 deletions holo-tools/src/yang_coverage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T> {
Expand Down
2 changes: 1 addition & 1 deletion holo-tools/src/yang_deviations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion holo-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }

Expand Down
Loading

0 comments on commit 9d21ec4

Please sign in to comment.