Update deps

Signed-off-by: Igor Raits <ignatenkobrain@fedoraproject.org>
This commit is contained in:
Igor Raits 2020-02-11 15:25:40 +01:00
parent 9146e0456d
commit dec3766648
No known key found for this signature in database
GPG Key ID: 695714BD1BBC5F4C
4 changed files with 4 additions and 169 deletions

View File

@ -1,37 +0,0 @@
This reverts commit 7e870a1d51935c5ca8954b4b006387bbbf719d65.
---
src/providers/vagrant_virtualbox/mod.rs | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/src/providers/vagrant_virtualbox/mod.rs b/src/providers/vagrant_virtualbox/mod.rs
index 975ae9c..4c45bc2 100644
--- a/src/providers/vagrant_virtualbox/mod.rs
+++ b/src/providers/vagrant_virtualbox/mod.rs
@@ -68,10 +68,7 @@ impl MetadataProvider for VagrantVirtualboxProvider {
fn attributes(&self) -> Result<HashMap<String, String>> {
let mut out = HashMap::with_capacity(2);
- let hostname = hostname::get()
- .chain_err(|| "unable to get hostname")?
- .to_string_lossy()
- .into_owned();
+ let hostname = hostname::get_hostname().ok_or("unable to get hostname")?;
let ip = VagrantVirtualboxProvider::get_ip()?;
out.insert("VAGRANT_VIRTUALBOX_HOSTNAME".to_string(), hostname);
@@ -81,11 +78,7 @@ impl MetadataProvider for VagrantVirtualboxProvider {
}
fn hostname(&self) -> Result<Option<String>> {
- let hostname = hostname::get()
- .chain_err(|| "unable to get hostname")?
- .to_string_lossy()
- .into_owned();
- Ok(Some(hostname))
+ Ok(hostname::get_hostname())
}
fn ssh_keys(&self) -> Result<Vec<PublicKey>> {
--
2.25.0

View File

@ -1,87 +0,0 @@
This reverts commit 322105d38f386363e088fa4a21984230241eed2c.
---
src/retry/client.rs | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/src/retry/client.rs b/src/retry/client.rs
index 0771767..41d19e2 100644
--- a/src/retry/client.rs
+++ b/src/retry/client.rs
@@ -23,7 +23,8 @@ use std::borrow::Cow;
use std::io::Read;
use std::time::Duration;
-use reqwest::{self, blocking, header, Method};
+use reqwest::header;
+use reqwest::{self, Method, Request};
use slog_scope::info;
use serde;
@@ -94,7 +95,7 @@ impl Deserializer for Raw {
#[derive(Debug, Clone)]
pub struct Client {
- client: blocking::Client,
+ client: reqwest::Client,
headers: header::HeaderMap,
retry: Retry,
return_on_404: bool,
@@ -102,7 +103,7 @@ pub struct Client {
impl Client {
pub fn try_new() -> Result<Self> {
- let client = blocking::Client::builder()
+ let client = reqwest::Client::builder()
.build()
.chain_err(|| "failed to initialize client")?;
Ok(Client {
@@ -183,7 +184,7 @@ where
url: String,
body: Option<String>,
d: D,
- client: blocking::Client,
+ client: reqwest::Client,
headers: header::HeaderMap,
retry: Retry,
return_on_404: bool,
@@ -203,7 +204,7 @@ where
T: for<'de> serde::Deserialize<'de>,
{
let url = reqwest::Url::parse(self.url.as_str()).chain_err(|| "failed to parse uri")?;
- let mut req = blocking::Request::new(Method::GET, url);
+ let mut req = Request::new(Method::GET, url);
req.headers_mut().extend(self.headers.clone().into_iter());
self.retry.clone().retry(|attempt| {
@@ -216,7 +217,7 @@ where
let url = reqwest::Url::parse(self.url.as_str()).chain_err(|| "failed to parse uri")?;
self.retry.clone().retry(|attempt| {
- let mut builder = blocking::Client::new()
+ let mut builder = reqwest::Client::new()
.post(url.clone())
.headers(self.headers.clone())
.header(header::CONTENT_TYPE, self.d.content_type());
@@ -241,7 +242,7 @@ where
})
}
- fn dispatch_request<T>(&self, req: &blocking::Request) -> Result<Option<T>>
+ fn dispatch_request<T>(&self, req: &Request) -> Result<Option<T>>
where
T: for<'de> serde::Deserialize<'de>,
{
@@ -273,8 +274,8 @@ where
/// Reqwests Request struct doesn't implement `Clone`,
/// so we have to do it here.
-fn clone_request(req: &blocking::Request) -> blocking::Request {
- let mut newreq = blocking::Request::new(req.method().clone(), req.url().clone());
+fn clone_request(req: &Request) -> Request {
+ let mut newreq = Request::new(req.method().clone(), req.url().clone());
newreq
.headers_mut()
.extend(req.headers().clone().into_iter());
--
2.25.0

View File

@ -1,33 +0,0 @@
--- afterburn-4.3.1/Cargo.toml 2020-01-21T15:19:26+00:00
+++ afterburn-4.3.1/Cargo.toml 2020-02-07T18:51:22.734139+00:00
@@ -45,10 +45,10 @@
default-features = false
[dependencies.hostname]
-version = "0.3"
+version = "0.1"
[dependencies.ipnetwork]
-version = "^0.16.0"
+version = "^0.14.0"
[dependencies.maplit]
version = "^1.0.2"
@@ -66,14 +66,13 @@
version = "^0.10.26"
[dependencies.pnet_base]
-version = "^0.25.0"
+version = "^0.22.0"
[dependencies.pnet_datalink]
-version = "^0.25.0"
+version = "^0.22.0"
[dependencies.reqwest]
-version = "^0.10.1"
-features = ["blocking"]
+version = "^0.9.24"
[dependencies.serde]
version = "1.0"

View File

@ -8,24 +8,13 @@
Name: rust-%{crate} Name: rust-%{crate}
Version: 4.3.1 Version: 4.3.1
Release: 1%{?dist} Release: 2%{?dist}
Summary: Simple cloud provider agent Summary: Simple cloud provider agent
# Upstream license specification: Apache-2.0 # Upstream license specification: Apache-2.0
License: ASL 2.0 License: ASL 2.0
URL: https://crates.io/crates/afterburn URL: https://crates.io/crates/afterburn
Source: %{crates_source} Source: %{crates_source}
# Initial patched metadata
Patch0: afterburn-fix-metadata.diff
# Use deprecated get_hostname calls so that hostname 0.1 can be used as
# a dependency. TODO: remove patch once at least hostname 0.2 is packaged
# in Fedora.
# https://github.com/svartalf/hostname/blob/master/CHANGELOG.md#020---2019-11-09
Patch1: 0001-Revert-providers-vagrant-fix-deprecated-calls.patch
# Use older request API so reqwest 0.9.24 can be used as a dependency.
# TODO: remove patch once at least reqwest 0.10.0 is packaged in Fedora.
# https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md#v0100
Patch2: 0002-Revert-afterburn-update-to-new-reqwest-API.patch
ExclusiveArch: %{rust_arches} ExclusiveArch: %{rust_arches}
@ -113,6 +102,9 @@ cp -a dracut/* %{buildroot}%{dracutmodulesdir}
%endif %endif
%changelog %changelog
* Tue Feb 11 15:24:47 CET 2020 Igor Raits <ignatenkobrain@fedoraproject.org> - 4.3.1-2
- Update deps
* Fri Feb 07 2020 Robert Fairley <rfairley@redhat.com> - 4.3.1-1 * Fri Feb 07 2020 Robert Fairley <rfairley@redhat.com> - 4.3.1-1
- Update to 4.3.1 - Update to 4.3.1