mirror of
https://git.proxmox.com/git/pve-access-control
synced 2025-07-26 23:43:58 +00:00
api/ticket: move getting cluster name into an eval
to avoid a failed login if a broken corosync config is setup Reviewed-by: Dominik Csapak <d.csapak@proxmox.com> Tested-by: Dominik Csapak <d.csapak@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
f5a9380a6f
commit
b27ae8aa44
@ -281,11 +281,14 @@ __PACKAGE__->register_method ({
|
||||
|
||||
if (PVE::Corosync::check_conf_exists(1)) {
|
||||
if ($rpcenv->check($username, '/', ['Sys.Audit'], 1)) {
|
||||
eval {
|
||||
my $conf = cfs_read_file('corosync.conf');
|
||||
my $totem = PVE::Corosync::totem_config($conf);
|
||||
if ($totem->{cluster_name}) {
|
||||
$res->{clustername} = $totem->{cluster_name};
|
||||
}
|
||||
};
|
||||
warn "$@\n" if $@;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user