misc fixes for create and list
This commit is contained in:
parent
419a0149aa
commit
27f50bcd73
|
@ -25,7 +25,13 @@ our $VERSION = '0.0.1';
|
|||
|
||||
set virtualization => "CBSD";
|
||||
|
||||
use Data::Dumper;
|
||||
|
||||
print Dumper vm 'create', name=>'foo',
|
||||
'vm_os_type'=>'freebsd',
|
||||
'vm_os_profile'=>'FreeBSD-x64-13.0',
|
||||
'vm_ram'=>'1g',
|
||||
'vm_cpus'=>'1',
|
||||
'imgsize'=>'10g';
|
||||
|
||||
=cut
|
||||
|
||||
|
@ -207,7 +213,7 @@ The returned array is a hash of hashes. The first level hash is the jname.
|
|||
|
||||
nodename - The node name that this is set to run on.
|
||||
|
||||
vm - Name of the VM.
|
||||
name - Name of the VM.
|
||||
|
||||
jid - Jail ID/process ID of the VM if running. IF '0' it is not running.
|
||||
|
||||
|
|
|
@ -57,13 +57,13 @@ sub execute {
|
|||
|
||||
if ( defined( $opts{$key} ) ) {
|
||||
|
||||
# make sure it does not contain any tabs, spaces, =, \. /, ', ", or new lines.
|
||||
if ( $opts{$key} =~ /[\t\ \=\\\/\'\"\n]/ ) {
|
||||
# make sure it does not contain any tabs, single/double quotes, and new lines
|
||||
if ( $opts{$key} =~ /[\t\'\"\n]/ ) {
|
||||
die 'The value "'
|
||||
. $opts{$key}
|
||||
. '" for key "'
|
||||
. $key
|
||||
. '" matched /[\t\ \=\/\\\'\"\n]/, meaning it is not a valid value';
|
||||
. '" matched /[\t\'\"\n]/, meaning it is not a valid value';
|
||||
}
|
||||
|
||||
if ( defined( $opts{$key} ) ) {
|
||||
|
|
|
@ -45,13 +45,13 @@ sub execute {
|
|||
|
||||
# needs to be updated if display= is ever changed
|
||||
(
|
||||
$VM{'node'}, $VM{'vm'}, $VM{'pid'}, $VM{'ram'}, $VM{'curmem'}, $VM{'cpus'},
|
||||
$VM{'node'}, $VM{'name'}, $VM{'pid'}, $VM{'ram'}, $VM{'curmem'}, $VM{'cpus'},
|
||||
$VM{'pcpu'}, $VM{'os'}, $VM{'ip4'}, $VM{'status'}, $VM{'vnc'}, $VM{'path'}
|
||||
) = split( /[\ \t]+/, $line );
|
||||
$VMs{ $VM{'name'} } = \%VM;
|
||||
}
|
||||
|
||||
return \%VMs;
|
||||
return %VMs;
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
Loading…
Reference in New Issue