Skip to content

Commit

Permalink
Do not require "roles" in schedule
Browse files Browse the repository at this point in the history
  • Loading branch information
tailhook committed May 14, 2018
1 parent d9da5f5 commit d0c080f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/daemon/query/compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ impl Responder {
let roles = self.schedule.data.as_object()
.and_then(|x| x.get("roles"))
.and_then(|y| y.as_object())
.ok_or(err_msg("no roles in schedule"))?;
.unwrap_or_else(|| {
warn!("Can't find `roles[{}]` key in schedule\n",
self.hostname);
&empty
});
let vars = self.schedule.data.as_object()
.and_then(|x| x.get("vars"))
.and_then(|x| x.as_object())
Expand All @@ -40,8 +44,7 @@ impl Responder {
.and_then(|x| x.get(&self.hostname))
.and_then(|y| y.as_object())
.unwrap_or_else(|| {
warn!(
"Warning: Can't find `nodes[{}]` key in schedule\n",
warn!("Can't find `nodes[{}]` key in schedule\n",
self.hostname);
&empty
});
Expand Down

0 comments on commit d0c080f

Please sign in to comment.