diff --git a/Build.PL b/Build.PL index b694856d..9d608dfb 100644 --- a/Build.PL +++ b/Build.PL @@ -17,9 +17,9 @@ my $builder = Module::Build->new( 'File::Path' => 0, 'Getopt::Long' => 0, 'MooseX::ClassAttribute' => 0, - 'MooseX::FileAttribute' => 0, 'MooseX::NonMoose' => 0, 'MooseX::Singleton' => 0, + 'MooseX::Types::Path::Class' => 0, 'namespace::sweep' => 0, 'Quantum::Superpositions' => 0, 'Pod::Usage' => 0, diff --git a/debian/control b/debian/control index c7e6d905..247460ce 100644 --- a/debian/control +++ b/debian/control @@ -17,10 +17,10 @@ Build-Depends: debhelper (>= 8), libhash-storediterator-perl, liblog-log4perl-perl, libmoosex-classattribute-perl, - libmoosex-fileattribute-perl, libmoosex-method-signatures-perl, libmoosex-nonmoose-perl, libmoosex-singleton-perl, + libmoosex-types-path-class-perl, libnamespace-sweep-perl, libparse-debianchangelog-perl, libperl5i-perl, @@ -61,10 +61,10 @@ Depends: libaliased-perl, libhash-storediterator-perl, liblog-log4perl-perl, libmoosex-classattribute-perl, - libmoosex-fileattribute-perl, libmoosex-method-signatures-perl, libmoosex-nonmoose-perl, libmoosex-singleton-perl, + libmoosex-types-path-class-perl, libnamespace-sweep-perl, libparse-debianchangelog-perl, libperl5i-perl, diff --git a/lib/NGCP/Schema/Config.pm b/lib/NGCP/Schema/Config.pm index be650021..6b0db4c5 100644 --- a/lib/NGCP/Schema/Config.pm +++ b/lib/NGCP/Schema/Config.pm @@ -1,13 +1,20 @@ package NGCP::Schema::Config; use Sipwise::Base; use Log::Log4perl qw(); -use MooseX::FileAttribute qw(has_file); +use MooseX::Types::Path::Class qw(File); use MooseX::Singleton qw(has); use XML::Simple qw(); our $VERSION = '2.007'; -has_file('config_file', is => 'rw', required => 1, default => '/etc/ngcp-ossbss/provisioning.conf'); +has 'config_file' => ( + is => 'rw', + isa => File, + required => 1, + coerce => 1, + default => '/etc/ngcp-ossbss/provisioning.conf' +); + has('as_hash', isa => 'HashRef', is => 'rw', lazy => 1, default => method { return $self->check_config(XML::Simple->new->XMLin($self->config_file->stringify, ForceArray => 0)); });