Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions lib/Rex/Virtualization.pm
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,28 @@ my %VM_PROVIDER;

Rex::Config->register_config_handler(
virtualization => sub {
my ($param) = @_;
my ($params) = @_;

if ( ref($param) eq '' ) {
if ( ref($params) eq '' ) {

#support 'set virtualization => 'LibVirt', but leave the way open for using a hash in future
#other virtualisation drivers may need more settings...
$param = { type => $param };
$params = { type => $params };
}

if ( exists $param->{type} ) {
Rex::Config->set( virtualization => $param->{type} );
if ( ref($params) eq 'HASH' ) {

if ( exists $params->{type} ) {
Rex::Config->set( virtualization => $params );
}
else {
# Probably do some error thing here
}
}
else {
# Some error thing here so people dont go:
# set virtualzation => [qw/what is this anyway/']

}
}
);
Expand Down