mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-06-12 17:30:19 +00:00
-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:
@ -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;
|
||||
|
Reference in New Issue
Block a user