Commit 46dc12c0 authored by Francesc Guasch's avatar Francesc Guasch
Browse files

Merge branch '0.2.9' of https://github.com/UPC/ravada into 0.2.9

parents 09a4f767 88b8c012
......@@ -261,6 +261,12 @@ sub search_volume_re($self,$pattern,$refresh=0) {
return @volume;
}
sub _refresh_storage_pools($self) {
for my $pool ($self->vm->list_storage_pools) {
$pool->refresh();
}
}
=head2 search_volume_path_re
Searches for a volume in all the storage pools known to the Virtual Manager
......@@ -740,7 +746,6 @@ sub _domain_create_from_base {
my @device_disk = $self->_create_disk($base, $args{name});
$self->storage_pool->refresh();
# _xml_modify_cdrom($xml);
_xml_remove_cdrom($xml);
my ($node_name) = $xml->findnodes('/domain/name/text()');
......@@ -821,6 +826,7 @@ sub _iso_name {
." from $iso->{url}. It may take several minutes"
) if $req;
_download_file_external($iso->{url}, $device);
$self->_refresh_storage_pools();
die "Download failed, file $device missing.\n"
if ! -e $device;
......
......@@ -1506,29 +1506,26 @@ sub copy_machine {
$disk = 0 if $disk && $disk !~ /^\d+(\.\d+)?$/;
$disk = int($disk*1024*1024*1024) if $disk;
my $rebase = $c->param('copy_rebase');
my ($param_name) = grep /^copy_name_\d+/,(@{$c->req->params->names});
my $base = $RAVADA->search_domain_by_id($id_base);
my $name = $c->req->param($param_name) if $param_name;
$name = $base->name."-".$USER->name if !$name;
return create_domain($c, $id_base, $name, $ram, $disk)
if $base->is_base && !$rebase;
if (!$base->is_base) {
my $req = Ravada::Request->prepare_base(
id_domain => $id_base
,uid => $USER->id
);
return $c->render("Problem preparing base for domain ".$base->name)
if !$req;
my $req = Ravada::Request->prepare_base(
id_domain => $id_base
,uid => $USER->id
);
return $c->render("Problem preparing base for domain ".$base->name)
if $rebase && !$req;
sleep 1;
sleep 1;
# TODO fix requests for the same domain must queue
}
my @create_args =( memory => $ram ) if $ram;
push @create_args , ( disk => $disk ) if $disk;
$req = Ravada::Request->create_domain(
my $req2 = Ravada::Request->create_domain(
name => $name
, id_base => $id_base
, id_owner => $USER->id
......
......@@ -6,7 +6,7 @@
<form name="new_userForm" role="form" method="post" action="/users/register" novalidate>
<div class="from-group">
<label for="username">Username</label>
<input class="form-control" ng-model="username" placeholder="Enter Username" type="text" ng-maxlength="20" ng-minlength="5" name="username" ng-pattern="/^[a-zA-Z0-9]*$/" id="username" required=""><br/>
<input class="form-control" ng-model="username" placeholder="Enter Username" type="text" ng-maxlength="20" ng-minlength="5" name="username" ng-pattern="/^[a-zA-Z_.-]*$/" id="username" required=""><br/>
</div>
<div class="from-group">
......@@ -30,7 +30,7 @@
<strong>Error</strong> Username must be at least 5 characters.
</div>
<div ng-show="new_userForm.username.$error.pattern" class="alert alert-warning fade in">
<strong>Error</strong> Username can only contain words and numbers.
<strong>Error</strong> Username can only contain words, numbers, dashes, dots and underscores.
</div>
</div>
......
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