Commit f169062a authored by Francesc Guasch's avatar Francesc Guasch
Browse files

Fixed request result done

parent 8c4b97bb
......@@ -6,7 +6,6 @@ use strict;
use Carp qw(carp);
use Data::Dumper;
use DBIx::Connector;
use JSON::XS;
use Moose;
use YAML;
......@@ -490,7 +489,6 @@ sub list_vm_types {
my %type;
for my $vm (@{$self->vm}) {
warn $vm;
my ($name) = ref($vm) =~ /.*::(.*)/;
$type{$name}++;
}
......@@ -591,7 +589,7 @@ sub _cmd_list_vm_types {
my $request = shift;
$request->status('working');
my @list_types = $self->list_vm_types();
$request->result(encode_json( \@list_types));
$request->result(\@list_types);
$request->status('done');
}
......
......@@ -319,13 +319,14 @@ sub result {
if (defined $value ) {
my $sth = $$CONNECTOR->dbh->prepare("UPDATE requests set result=? "
." WHERE id=?");
$sth->execute($value, $self->{id});
$sth->execute(encode_json($value), $self->{id});
$sth->finish;
} else {
my $sth = $$CONNECTOR->dbh->prepare("SELECT result FROM requests where id=? ");
$sth->execute($self->{id});
($value) = $sth->fetchrow;
$value = decode_json($value);
$sth->finish;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment