From 7e6b625b78e1d031fed218554a72c9a8826620e3 Mon Sep 17 00:00:00 2001 From: Sam Batschelet Date: Sat, 13 Oct 2018 10:30:38 -0400 Subject: [PATCH 1/3] Actions.pm: add retry_auth to list of keys to omit. --- lib/Net/Etcd/Role/Actions.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Net/Etcd/Role/Actions.pm b/lib/Net/Etcd/Role/Actions.pm index 40f1f98..4915850 100644 --- a/lib/Net/Etcd/Role/Actions.pm +++ b/lib/Net/Etcd/Role/Actions.pm @@ -43,7 +43,7 @@ sub _build_json_args { my ($self) = @_; my $args; for my $key ( keys %{$self} ) { - unless ( $key =~ /(?:etcd|cb|cv|hold|json_args|endpoint)$/ ) { + unless ( $key =~ /(?:retry_auth|etcd|cb|cv|hold|json_args|endpoint)$/ ) { $args->{$key} = $self->{$key}; } } From 66d85fab0747555fff9a32cdab6226b7002e0dea Mon Sep 17 00:00:00 2001 From: Sam Batschelet Date: Sat, 13 Oct 2018 10:38:56 -0400 Subject: [PATCH 2/3] Lease.pm: Remove Bool type check and replace with Any. resolves errors such as : Reference bless( do{\(my $o = 1)}, 'JSON::PP::Boolean' ) did not pass type constraint "Bool" (in $args->{"keys"}) For now the failure is not worth the type check but I am unsure why JSON expands the bool here. I can not replicate locally but Travis reports this every run. --- lib/Net/Etcd/Lease.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Net/Etcd/Lease.pm b/lib/Net/Etcd/Lease.pm index 6894f17..591dbe3 100644 --- a/lib/Net/Etcd/Lease.pm +++ b/lib/Net/Etcd/Lease.pm @@ -5,7 +5,7 @@ use strict; use warnings; use Moo; -use Types::Standard qw(Str Int Bool HashRef ArrayRef); +use Types::Standard qw(Str Int Any HashRef ArrayRef); use Data::Dumper; use Carp; use JSON; @@ -69,7 +69,7 @@ keys is true to query all the keys attached to this lease. has keys => ( is => 'ro', - isa => Bool, + isa => Any, coerce => sub { no strict 'refs'; return $_[0] ? JSON::true : JSON::false } ); From 68fff5f37c68877cf6deced20592031d1e576a39 Mon Sep 17 00:00:00 2001 From: Sam Batschelet Date: Sat, 13 Oct 2018 10:47:45 -0400 Subject: [PATCH 3/3] Update Changelog to reflect bugfix. --- Changes | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Changes b/Changes index 59594f0..06dd4a1 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,11 @@ Revision history for Net::Etcd +0.023 +[ BUG FIX ] +* Fix a bug where the Bool type would fail under certain circumstances when setting keys => 1 for ttl. +While I could replicate, travis tests failed consistantly, we will resolve this better in the future. +Reference bless( do{\(my $o = 1)}, 'JSON::PP::Boolean' ) did not pass type constraint "Bool" (in $args->{"keys"}) + 0.022 [ ENHANCEMENTS ] * Improve support for prefix inline with etcd API. Fixes GH #53 Thanks Michael Fung! @@ -27,7 +33,7 @@ Revision history for Net::Etcd 0.018 [ ENHANCEMENTS ] * Added Member class and tests. -* Added ENV defaults for name 'ETCD_CLIENT_USERNAME', password 'ETCD_CLIENT_PASSWORD' and cacert 'ETCD_CERT_FILE' accessors. +* Added ENV defaults for name 'ETCD_CLIENT_USERNAME', password 'ETCD_CLIENT_PASSWORD' and cacert 'ETCD_CERT_FILE' accessors. * Updated TLS example. 0.017 @@ -49,7 +55,7 @@ Revision history for Net::Etcd 0.014 [ BUG FIX ] -* Resolved bug which prevented range delete transaction from completing. Closed via GH #25 Thanks Ananth Kavuri! +* Resolved bug which prevented range delete transaction from completing. Closed via GH #25 Thanks Ananth Kavuri! [ ANNOUNCEMENT ] * Added class Net::Etcd::KV::RangeDelete