Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Ravada-Mirror
Commits
d05727dc
Commit
d05727dc
authored
Apr 11, 2017
by
Francesc Guasch
Browse files
Add a warn_error flag to the ravada main object
parent
eaf7bfe2
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/Ravada.pm
View file @
d05727dc
...
...
@@ -72,6 +72,12 @@ has 'config' => (
,
isa
=>
'
Str
'
);
has
'
warn_error
'
=>
(
is
=>
'
rw
'
,
isa
=>
'
Bool
'
,
default
=>
sub
{
1
}
);
=head2 BUILD
Internal constructor
...
...
@@ -262,7 +268,7 @@ sub _connect_vm {
my
@vms
;
eval
{
@vms
=
$self
->
vm
};
warn
$@
if
$@
;
warn
$@
if
$@
&&
$self
->
warn_error
;
return
if
$@
&&
$@
=~
/No VMs found/i
;
die
$@
if
$@
;
...
...
@@ -298,7 +304,7 @@ sub _create_vm {
$err
.=
"
\n
$err_lxc
"
if
$err_lxc
;
}
if
(
!
@vms
)
{
warn
"
No VMs found:
$err
\n
";
warn
"
No VMs found:
$err
\n
"
if
$self
->
warn_error
;
}
return
\
@vms
;
...
...
t/lib/Test/Ravada.pm
View file @
d05727dc
...
...
@@ -92,6 +92,7 @@ sub rvd_back {
return
Ravada
->
new
(
connector
=>
$CONNECTOR
,
config
=>
(
$CONFIG
or
$DEFAULT_CONFIG
)
,
warn_error
=>
0
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment