Fix nodelist segment being sent from queue where gethostname() is only a container name, added ability to control filename when sending nodelist segment
This commit is contained in:
@@ -18,7 +18,7 @@ class NodelistSegment extends Dynamic
|
||||
{
|
||||
private const LOGKEY = 'DNL';
|
||||
|
||||
private string $name = '';
|
||||
private ?string $name;
|
||||
private Address $our_address;
|
||||
private Carbon $now;
|
||||
|
||||
@@ -27,11 +27,7 @@ class NodelistSegment extends Dynamic
|
||||
$this->our_address = our_address($ao->zone->domain)->first();
|
||||
$this->now = Carbon::now();
|
||||
|
||||
$this->name = sprintf('z%dn%d.%d',
|
||||
$this->our_address->zone->zone_id,
|
||||
$this->our_address->host_id,
|
||||
$this->now->format('z'),
|
||||
);
|
||||
$this->name = $arg->get('name','');
|
||||
|
||||
Log::debug(sprintf('%s:- Generating Nodelist for [%s] from [%s] as [%s] with arguments',self::LOGKEY,$ao->ftn,$this->our_address->ftn,$this->our_address->role_name),['args'=>$arg]);
|
||||
}
|
||||
@@ -157,6 +153,8 @@ class NodelistSegment extends Dynamic
|
||||
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->name;
|
||||
return ($this->name ?: sprintf('z%dn%d',
|
||||
$this->our_address->zone->zone_id,
|
||||
$this->our_address->host_id)).'.'.sprintf('%03d',$this->now->format('z'));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user