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

[#507] moved global arg to common method

parent b5059ba0
......@@ -22,6 +22,7 @@ create_domain
test_chain_prerouting
search_id_iso
flush_rules open_ipt
arg_create_dom
);
our $DEFAULT_CONFIG = "t/etc/ravada.conf";
......@@ -32,10 +33,19 @@ our $CONT_POOL= 0;
our $USER_ADMIN;
our $CHAIN = 'RAVADA';
our %ARG_CREATE_DOM = ();
sub user_admin {
return $USER_ADMIN;
}
sub arg_create_dom {
my $vm_name = shift;
confess "Unknown vm $vm_name"
if !$ARG_CREATE_DOM{$vm_name};
return @{$ARG_CREATE_DOM{$vm_name}};
}
sub create_domain {
my $vm_name = shift;
my $user = (shift or $USER_ADMIN);
......@@ -103,6 +113,9 @@ sub rvd_back {
);
$rvd->_update_isos();
$USER_ADMIN = create_user('admin','admin',1) if !$USER_ADMIN;
$ARG_CREATE_DOM{KVM} = [ id_iso => search_id_iso('Alpine') ];
return $rvd;
}
......@@ -127,6 +140,7 @@ sub init {
$USER_ADMIN = create_user('admin','admin',1) if $create_user;
$Ravada::Domain::MIN_FREE_MEMORY = 512*1024;
}
sub _remove_old_domains_vm {
......
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