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
7353cb94
Commit
7353cb94
authored
Jul 04, 2016
by
fv3rdugo
Browse files
list_domains read from database instead list_domain() function from Sys::Virt
parent
e931e05b
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/Ravada.pm
View file @
7353cb94
...
...
@@ -261,20 +261,34 @@ List all domains in raw format. Return a list of id => { name , id , is_active ,
sub
list_domains_data
{
my
$self
=
shift
;
my
@domains
;
for
my
$domain
(
$self
->
list_domains
())
{
eval
{
$domain
->
id
};
warn
$@
if
$@
;
next
if
$@
;
push
@domains
,
{
id
=>
$domain
->
id
,
name
=>
$domain
->
name
,
is_base
=>
$domain
->
is_base
,
is_active
=>
$domain
->
is_active
}
my
$sth
=
$CONNECTOR
->
dbh
->
prepare
(
"
SELECT * FROM domains ORDER BY name
"
);
$sth
->
execute
;
while
(
my
$row
=
$sth
->
fetchrow_hashref
)
{
push
@domains
,(
$row
);
}
$sth
->
finish
;
return
\
@domains
;
}
# sub list_domains_data {
# my $self = shift;
# my @domains;
# for my $domain ($self->list_domains()) {
# eval { $domain->id };
# warn $@ if $@;
# next if $@;
# push @domains, { id => $domain->id
# , name => $domain->name
# ,is_base => $domain->is_base
# ,is_active => $domain->is_active
# }
# }
# return \@domains;
# }
=head2 list_bases
...
...
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