[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Ovirt-devel] [PATCH appliance] Create cobbler system entries for fake nodes with custom kopts



Perry Myers <pmyers redhat com> wrote:
> node3 is created with ovirt_init=scsi causing the supplied 128MB
> disk to be used for config info
>
> node4 is created with ovirt_init=scsi and ovirt_local_boot
> installing the node itself on the local disk.  To fully test
> local boot the node configuration needs to be reset to boot
> hd instead of net.
>
> node5 is left alone for pxe boot with no local storage
>
> One liner to toggle boot type for a domain:
>
> OUT=$(mktemp) && virsh dumpxml node4 \
>   | sed "s/boot dev='.*'/boot dev='hd'/" > $OUT \
>   && virsh define $OUT ; rm -f $OUT

To be slightly safer, use '[^']*' in place of '.*'.
Then, if the XML is ever formatted so that there's another
single quote after the desired one, the substitution won't gobble
up everything in between.

Or just use perl's non-greedy "?" modifier:

  perl -pe "s/(boot dev)='.*?'/\$1='hd'/" > $OUT \

...
> diff --git a/ovirt-appliance.ks b/ovirt-appliance.ks
> index ebaaba2..7680c83 100644
> --- a/ovirt-appliance.ks
> +++ b/ovirt-appliance.ks
...

+1 for the better test coverage
ACK


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]