[Ovirt-devel] [PATCH] Changed the source for UUID to be dmidecode for now.

Perry N. Myers pmyers at redhat.com
Wed Jun 25 23:50:35 UTC 2008


Jeff Schroeder wrote:
> On Wed, Jun 25, 2008 at 1:45 PM, Darryl L. Pierce <dpierce at redhat.com> wrote:
>> Signed-off-by: Darryl L. Pierce <dpierce at redhat.com>
>> ---
>>  ovirt-host-creator/common-pkgs.ks            |    1 +
>>  ovirt-host-creator/common-post.ks            |   11 ++++++++++-
>>  ovirt-managed-node/src/ovirt-identify-node.c |    3 ++-
>>  3 files changed, 13 insertions(+), 2 deletions(-)
>>
>> diff --git a/ovirt-host-creator/common-pkgs.ks b/ovirt-host-creator/common-pkgs.ks
>> index 6fe4f26..3ad8fa0 100644
>> --- a/ovirt-host-creator/common-pkgs.ks
>> +++ b/ovirt-host-creator/common-pkgs.ks
>> @@ -26,6 +26,7 @@ augeas
>>  nc
>>  bind-utils
>>  syslinux
>> +dmidecode
>>  ovirt-managed-node
>>  -policycoreutils
>>  -audit-libs-python
>> diff --git a/ovirt-host-creator/common-post.ks b/ovirt-host-creator/common-post.ks
>> index a7dc987..a35f40e 100644
>> --- a/ovirt-host-creator/common-post.ks
>> +++ b/ovirt-host-creator/common-post.ks
>> @@ -237,7 +237,16 @@ start() {
>>     echo -n $"Starting ovirt-post: "
>>
>>     find_srv identify tcp
>> -    ovirt-identify-node -s $SRV_HOST -p $SRV_PORT
>> +
>> +    VENDOR=`dmidecode | grep Vendor | awk ' { print $2; } '`
>> +    UUID=`dmidecode | grep UUID | awk ' { print $2; } '`
> 
> Tiny nit that might be shot down by someone who dislikes awk.
> 
> These are functionally identical:
> dmidecode | grep UUID | awk ' { print $2; } '
> dmidecode | awk ' /UUID/{ print $2; } '
> 
> grep | awk is used allover the codebase though.
> 

Good catch.  One less pipe is always a good idea, especially since awk has 
all of that built in.

If you see other places in the code where we do grep | awk and it can be 
replaced with just plain awk, feel free to submit some patches.

Perry

Perry

-- 
|=-        Red Hat, Engineering, Emerging Technologies, Boston        -=|
|=-                     Email: pmyers at redhat.com                      -=|
|=-         Office: +1 412 474 3552   Mobile: +1 703 362 9622         -=|
|=- GnuPG: E65E4F3D 88F9 F1C9 C2F3 1303 01FE 817C C5D2 8B91 E65E 4F3D -=|




More information about the ovirt-devel mailing list