From c4992fa2c1f073e35d9e47d76bdc895c0d907830 Mon Sep 17 00:00:00 2001 From: Felix Ehrenpfort Date: Mon, 28 Aug 2023 21:51:01 +0200 Subject: [PATCH] Rename PUBLIC_IPV4 to IPV4_PUBLIC Signed-off-by: Felix Ehrenpfort --- src/providers/scaleway/mock_tests.rs | 6 +++--- src/providers/scaleway/mod.rs | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/providers/scaleway/mock_tests.rs b/src/providers/scaleway/mock_tests.rs index ec41200d..a0aa1dbc 100644 --- a/src/providers/scaleway/mock_tests.rs +++ b/src/providers/scaleway/mock_tests.rs @@ -26,9 +26,9 @@ fn test_attributes() { "SCALEWAY_INSTANCE_ID".to_string() => "11111111-1111-1111-1111-111111111111".to_string(), "SCALEWAY_INSTANCE_TYPE".to_string() => "GP1-M".to_string(), "SCALEWAY_HOSTNAME".to_string() => "frontend-0".to_string(), - "SCALEWAY_PRIVATE_IPV4".to_string() => "10.0.0.2".to_string(), - "SCALEWAY_PUBLIC_IPV4".to_string() => "93.184.216.34".to_string(), - "SCALEWAY_PUBLIC_IPV6".to_string() => "2001:db8::1".to_string(), + "SCALEWAY_IPV4_PRIVATE".to_string() => "10.0.0.2".to_string(), + "SCALEWAY_IPV4_PUBLIC".to_string() => "93.184.216.34".to_string(), + "SCALEWAY_IPV6_PUBLIC".to_string() => "2001:db8::1".to_string(), "SCALEWAY_ZONE_ID".to_string() => "par1".to_string(), }; diff --git a/src/providers/scaleway/mod.rs b/src/providers/scaleway/mod.rs index c833cd22..62e035cb 100644 --- a/src/providers/scaleway/mod.rs +++ b/src/providers/scaleway/mod.rs @@ -43,17 +43,17 @@ struct ScalewaySSHPublicKey { #[derive(Clone, Deserialize)] struct ScalwayInterfaces { private_ip: Option, - public_ip: Option, - ipv6: Option, + public_ip: Option, + ipv6: Option, } #[derive(Clone, Deserialize)] -struct ScalewayPublicIPv4 { +struct ScalewayIPv4Public { address: String, } #[derive(Clone, Deserialize)] -struct ScalewayPublicIPv6 { +struct ScalewayIPv6Public { address: String, } @@ -110,15 +110,15 @@ impl ScalewayProvider { ]; if let Some(ref ip) = data.interfaces.private_ip { - attrs.push(("SCALEWAY_PRIVATE_IPV4".to_string(), ip.clone())); + attrs.push(("SCALEWAY_IPV4_PRIVATE".to_string(), ip.clone())); } if let Some(ref ip) = data.interfaces.public_ip { - attrs.push(("SCALEWAY_PUBLIC_IPV4".to_string(), ip.address.clone())); + attrs.push(("SCALEWAY_IPV4_PUBLIC".to_string(), ip.address.clone())); } if let Some(ref ip) = data.interfaces.ipv6 { - attrs.push(("SCALEWAY_PUBLIC_IPV6".to_string(), ip.address.clone())); + attrs.push(("SCALEWAY_IPV6_PUBLIC".to_string(), ip.address.clone())); } Ok(attrs)