Commit 9f7b1d77 authored by Alexandre Pere's avatar Alexandre Pere

Removes Warning

parent 391d383a
...@@ -17,6 +17,7 @@ rust-crypto = "0.2" ...@@ -17,6 +17,7 @@ rust-crypto = "0.2"
uuid = { version = "0.6", features = ["serde", "v4"] } uuid = { version = "0.6", features = ["serde", "v4"] }
rpassword = "0.0.4" rpassword = "0.0.4"
ssh2 = "0.3.3" ssh2 = "0.3.3"
shells = "0.2.0"
dirs = "1.0" dirs = "1.0"
url = "1.7.2" url = "1.7.2"
git2 = {version = "0.8"} git2 = {version = "0.8"}
...@@ -27,6 +28,7 @@ walkdir = "2.2.7" ...@@ -27,6 +28,7 @@ walkdir = "2.2.7"
libc = "0.2" libc = "0.2"
globset = "0.4.4" globset = "0.4.4"
tracing = "0.1.10" tracing = "0.1.10"
tracing-subscriber = "0.1.6"
tracing-attributes = "0.1.5" tracing-attributes = "0.1.5"
tracing-futures = {version = "0.1.0", features=["futures-preview"]} tracing-futures = {version = "0.1.0", features=["futures-preview"]}
derivative = "1.0.3" derivative = "1.0.3"
......
...@@ -759,7 +759,7 @@ async fn allocate_nodes(frontend: &Frontend, ...@@ -759,7 +759,7 @@ async fn allocate_nodes(frontend: &Frontend,
// If the allocation failed we return an error // If the allocation failed we return an error
misc::compact_outputs(outputs) misc::compact_outputs(outputs)
.result() .result()
.map_err(|e| Error::AllocationFailed(format!("Failed to allocate on command")))?; .map_err(|e| Error::AllocationFailed(format!("Failed to allocate on command: {}", e)))?;
// We return the Allocation context // We return the Allocation context
Ok(FrontendContext(context)) Ok(FrontendContext(context))
} }
......
#![feature(trace_macros, async_await, result_map_or_else, trait_alias, try_blocks)] #![feature(result_map_or_else, trait_alias, try_blocks)]
//! liborchestra/mod.rs //! liborchestra/mod.rs
//! //!
//! Liborchestra: //! Liborchestra:
......
...@@ -15,8 +15,7 @@ use crate::ssh::RemoteHandle; ...@@ -15,8 +15,7 @@ use crate::ssh::RemoteHandle;
use globset; use globset;
use std::io::Read; use std::io::Read;
use std::fmt; use std::fmt;
use tracing::{self, error, trace, warn, instrument, trace_span}; use tracing::{self, instrument};
use tracing_futures::Instrument;
......
...@@ -898,7 +898,8 @@ impl CampaignHandle { ...@@ -898,7 +898,8 @@ impl CampaignHandle {
_dropper: Dropper::from_closure( _dropper: Dropper::from_closure(
Box::new(move ||{ Box::new(move ||{
drop_sender.close_channel(); drop_sender.close_channel();
handle.join(); handle.join()
.unwrap_or_else(|_| {error!("Failed to wait")});
}), }),
format!("CampaignHandle")), format!("CampaignHandle")),
}) })
......
...@@ -29,7 +29,6 @@ use futures::channel::mpsc::{UnboundedSender}; ...@@ -29,7 +29,6 @@ use futures::channel::mpsc::{UnboundedSender};
use std::fmt::{Display, Debug}; use std::fmt::{Display, Debug};
use std::process::Command; use std::process::Command;
use crate::*; use crate::*;
use serde::{Deserialize, Serialize};
use serde_json; use serde_json;
use std::os::unix::process::ExitStatusExt; use std::os::unix::process::ExitStatusExt;
use tracing::{self, error, trace, instrument, trace_span}; use tracing::{self, error, trace, instrument, trace_span};
......
...@@ -671,7 +671,7 @@ impl<'s> Parser<'s> { ...@@ -671,7 +671,7 @@ impl<'s> Parser<'s> {
Some(Ok(Token(TokenType::Word, ib))) if ib.as_str() == "ProxyCommand" => { Some(Ok(Token(TokenType::Word, ib))) if ib.as_str() == "ProxyCommand" => {
self.consume_proxycommand_clause() self.consume_proxycommand_clause()
} }
Some(Ok(Token(TokenType::NewLine, ib))) => { Some(Ok(Token(TokenType::NewLine, _ib))) => {
None None
} }
Some(Ok(Token(TokenType::Word, ib))) => { Some(Ok(Token(TokenType::Word, ib))) => {
......
...@@ -348,7 +348,7 @@ impl ProxyCommandForwarder { ...@@ -348,7 +348,7 @@ impl ProxyCommandForwarder {
while kf1.load(Ordering::Relaxed) { while kf1.load(Ordering::Relaxed) {
match std::io::copy(&mut command_stdout, &mut socket1){ match std::io::copy(&mut command_stdout, &mut socket1){
Err(e) => { Err(e) => {
error!("stdout forwarding failed"); error!("stdout forwarding failed: {}", e);
break break
} }
Ok(0) => { Ok(0) => {
...@@ -373,7 +373,7 @@ impl ProxyCommandForwarder { ...@@ -373,7 +373,7 @@ impl ProxyCommandForwarder {
while kf2.load(Ordering::Relaxed) { while kf2.load(Ordering::Relaxed) {
match std::io::copy(&mut socket2, &mut command_stdin){ match std::io::copy(&mut socket2, &mut command_stdin){
Err(e) => { Err(e) => {
error!("stdin forwarding failed"); error!("stdin forwarding failed: {}", e);
break break
} }
Ok(0) => { Ok(0) => {
...@@ -600,7 +600,7 @@ impl std::fmt::Debug for OperationInput{ ...@@ -600,7 +600,7 @@ impl std::fmt::Debug for OperationInput{
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self{ match self{
OperationInput::Exec(c) => write!(f, "Exec({:?})", c), OperationInput::Exec(c) => write!(f, "Exec({:?})", c),
OperationInput::Pty(t, c, out, err) => write!(f, "Pty({:?}, {}, {})", c, stringify!(out), stringify!(err)), OperationInput::Pty(_, c, _out, _err) => write!(f, "Pty({:?}, {}, {})", c, stringify!(_out), stringify!(_err)),
OperationInput::ScpSend(a, b) => write!(f, "ScpSend({:?}, {:?})", a, b), OperationInput::ScpSend(a, b) => write!(f, "ScpSend({:?}, {:?})", a, b),
OperationInput::ScpFetch(a, b) => write!(f, "ScpFetch({:?}, {:?})", a, b), OperationInput::ScpFetch(a, b) => write!(f, "ScpFetch({:?}, {:?})", a, b),
} }
...@@ -1394,7 +1394,7 @@ mod test { ...@@ -1394,7 +1394,7 @@ mod test {
init(); init();
let (proxy_command, address) = ProxyCommandForwarder::from_command("echo kikou").unwrap(); let (proxy_command, address) = ProxyCommandForwarder::from_command("echo kikou").unwrap();
let mut stream = TcpStream::connect(address).unwrap(); let mut stream = TcpStream::connect(address).unwrap();
std::thread::sleep_ms(1000); std::thread::sleep(1000);
assert!(TcpStream::connect(address).is_err()); assert!(TcpStream::connect(address).is_err());
let mut buf = [0 as u8; 6]; let mut buf = [0 as u8; 6];
stream.read_exact(&mut buf).unwrap(); stream.read_exact(&mut buf).unwrap();
......
...@@ -15,7 +15,6 @@ use std::thread; ...@@ -15,7 +15,6 @@ use std::thread;
use futures::channel::mpsc::{UnboundedSender}; use futures::channel::mpsc::{UnboundedSender};
use std::fmt::Debug; use std::fmt::Debug;
use std::process::Command;
use crate::*; use crate::*;
use tracing::{self, warn, trace, instrument, trace_span}; use tracing::{self, warn, trace, instrument, trace_span};
use tracing_futures::Instrument; use tracing_futures::Instrument;
...@@ -160,6 +159,7 @@ impl<T> Slot<T>{ ...@@ -160,6 +159,7 @@ impl<T> Slot<T>{
/// Gives a handle to the inner. /// Gives a handle to the inner.
#[inline] #[inline]
#[allow(dead_code)]
pub fn as_arrayvec(&self) -> &ArrayVec<[Timed<T>; SLOT_LEN]>{ pub fn as_arrayvec(&self) -> &ArrayVec<[Timed<T>; SLOT_LEN]>{
&self.waiters &self.waiters
} }
...@@ -178,12 +178,14 @@ impl<T> Slot<T>{ ...@@ -178,12 +178,14 @@ impl<T> Slot<T>{
/// Returns the duration of the slot. /// Returns the duration of the slot.
#[inline] #[inline]
#[allow(dead_code)]
pub fn duration(&self) -> Duration{ pub fn duration(&self) -> Duration{
self.end-self.beginning self.end-self.beginning
} }
/// Returns the number of timed inside. /// Returns the number of timed inside.
#[inline] #[inline]
#[allow(dead_code)]
pub fn len(&self) -> usize{ pub fn len(&self) -> usize{
self.waiters.len() self.waiters.len()
} }
...@@ -337,10 +339,10 @@ impl<T> Timer<T>{ ...@@ -337,10 +339,10 @@ impl<T> Timer<T>{
if do_turn { if do_turn {
let slot = { let slot = {
let mut current_wheel = &mut self.0[w]; let current_wheel = &mut self.0[w];
current_wheel.turn() current_wheel.turn()
}; };
let mut previous_wheel = &mut self.0[w-1]; let previous_wheel = &mut self.0[w-1];
let res: Result<Vec<usize>, Timed<T>> = slot.to_vec() let res: Result<Vec<usize>, Timed<T>> = slot.to_vec()
.into_iter() .into_iter()
.map(|t| previous_wheel.try_insert(t)) .map(|t| previous_wheel.try_insert(t))
...@@ -363,6 +365,7 @@ impl<T> Timer<T>{ ...@@ -363,6 +365,7 @@ impl<T> Timer<T>{
} }
/// Returns the number of timed in the timer. /// Returns the number of timed in the timer.
#[allow(dead_code)]
pub fn len(&self) -> usize{ pub fn len(&self) -> usize{
self.0.iter().fold(0, |a, w| a+w.len()) self.0.iter().fold(0, |a, w| a+w.len())
} }
...@@ -473,7 +476,6 @@ impl TimerHandle{ ...@@ -473,7 +476,6 @@ impl TimerHandle{
match receiver.await { match receiver.await {
Err(e) => Err(Error::OperationFetch(format!("{}", e))), Err(e) => Err(Error::OperationFetch(format!("{}", e))),
Ok(OperationOutput::Sleep) => Ok(()), Ok(OperationOutput::Sleep) => Ok(()),
Ok(e) => Err(Error::OperationFetch(format!("Expected RequestParameters, found {:?}", e)))
} }
}.instrument(trace_span!("SchedulerHandle::async_request_parameters")) }.instrument(trace_span!("SchedulerHandle::async_request_parameters"))
} }
......
...@@ -18,8 +18,7 @@ use clap; ...@@ -18,8 +18,7 @@ use clap;
use uuid; use uuid;
use futures::executor::block_on; use futures::executor::block_on;
use crate::{to_exit}; use crate::{to_exit};
use liborchestra::commons::{EnvironmentValue, EnvironmentStore, use liborchestra::commons::{EnvironmentStore, substitute_environment, OutputBuf, push_env};
substitute_environment, OutputBuf, push_env};
use crate::misc; use crate::misc;
use crate::exit::Exit; use crate::exit::Exit;
use liborchestra::primitives; use liborchestra::primitives;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment