mirror of
https://git.proxmox.com/git/pve-common
synced 2025-04-29 03:05:24 +00:00
cache: allow importing nodename method
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
3d4739a9d3
commit
eb6f49f4b2
@ -25,7 +25,7 @@ use PVE::Tools;
|
||||
|
||||
use base 'Exporter';
|
||||
|
||||
our @EXPORT_OK = qw(read_file write_file register_file);
|
||||
our @EXPORT_OK = qw(read_file write_file register_file nodename);
|
||||
|
||||
my $ccache;
|
||||
my $ccachemap;
|
||||
@ -500,13 +500,10 @@ sub inotify_init {
|
||||
}
|
||||
|
||||
my $cached_nodename;
|
||||
|
||||
sub nodename {
|
||||
|
||||
return $cached_nodename if $cached_nodename;
|
||||
|
||||
my ($sysname, $nodename) = POSIX::uname();
|
||||
|
||||
$nodename =~ s/\..*$//; # strip domain part, if any
|
||||
|
||||
die "unable to read node name\n" if !$nodename;
|
||||
|
Loading…
Reference in New Issue
Block a user