-Reminder to implement UUID v1 subtype of RFC UUID for enchanced uniqueness guarantee
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6139 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
d8cdd90355
commit
4499d18915
@ -65,6 +65,10 @@ sub genUUID
|
||||
#Though a UUID of this form is not guaranteed to be unique absolutely,
|
||||
#the chances of a cluster the size of the entire internet generating
|
||||
#two identical UUIDs is 4 in 10 octillion.
|
||||
my %args = @_;
|
||||
if ($args{mac}) { #if a mac address was supplied, generate a uuidv1 instead
|
||||
#TODO: UUIDv1
|
||||
}
|
||||
srand(); #Many note this as bad practice, however, forks are going on..
|
||||
my $uuid;
|
||||
$uuid =
|
||||
|
@ -213,7 +213,15 @@ sub build_diskstruct {
|
||||
}
|
||||
sub getNodeUUID {
|
||||
my $node = shift;
|
||||
return xCAT::Utils::genUUID();
|
||||
if ($confdata->{mac}->{$node}->[0]) { #a uuidv1 is possible, generate that for absolute uniqueness guarantee
|
||||
my $mac = ($confdata->{mac}->{$node}->[0];
|
||||
$mac =~ s/\|.*//;
|
||||
$mac =~ s/!.*//;
|
||||
return xCAT::Utils::genUUID(mac=>$mac);
|
||||
} else {
|
||||
return xCAT::Utils::genUUID();
|
||||
}
|
||||
|
||||
}
|
||||
sub build_nicstruct {
|
||||
my $rethash;
|
||||
|
Loading…
Reference in New Issue
Block a user