mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-08 10:32:50 +00:00
api: mon create: code cleanup, redue heavy empty line usage
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
a6c60aed86
commit
7760a8beba
@ -140,25 +140,21 @@ __PACKAGE__->register_method ({
|
|||||||
my ($param) = @_;
|
my ($param) = @_;
|
||||||
|
|
||||||
PVE::Ceph::Tools::check_ceph_installed('ceph_mon');
|
PVE::Ceph::Tools::check_ceph_installed('ceph_mon');
|
||||||
|
|
||||||
PVE::Ceph::Tools::check_ceph_inited();
|
PVE::Ceph::Tools::check_ceph_inited();
|
||||||
|
|
||||||
PVE::Ceph::Tools::setup_pve_symlinks();
|
PVE::Ceph::Tools::setup_pve_symlinks();
|
||||||
|
|
||||||
my $rpcenv = PVE::RPCEnvironment::get();
|
my $rpcenv = PVE::RPCEnvironment::get();
|
||||||
|
|
||||||
my $authuser = $rpcenv->get_user();
|
my $authuser = $rpcenv->get_user();
|
||||||
|
|
||||||
my $cfg = cfs_read_file('ceph.conf');
|
my $cfg = cfs_read_file('ceph.conf');
|
||||||
|
|
||||||
my $moncount = 0;
|
my $moncount = 0;
|
||||||
|
|
||||||
my $monaddrhash = {};
|
my $monaddrhash = {};
|
||||||
|
|
||||||
foreach my $section (keys %$cfg) {
|
foreach my $section (keys %$cfg) {
|
||||||
next if $section eq 'global';
|
next if $section eq 'global';
|
||||||
my $d = $cfg->{$section};
|
|
||||||
if ($section =~ m/^mon\./) {
|
if ($section =~ m/^mon\./) {
|
||||||
|
my $d = $cfg->{$section};
|
||||||
$moncount++;
|
$moncount++;
|
||||||
if ($d->{'mon addr'}) {
|
if ($d->{'mon addr'}) {
|
||||||
$monaddrhash->{$d->{'mon addr'}} = $section;
|
$monaddrhash->{$d->{'mon addr'}} = $section;
|
||||||
@ -183,7 +179,6 @@ __PACKAGE__->register_method ({
|
|||||||
my $upid = shift;
|
my $upid = shift;
|
||||||
|
|
||||||
my $pve_ckeyring_path = PVE::Ceph::Tools::get_config('pve_ckeyring_path');
|
my $pve_ckeyring_path = PVE::Ceph::Tools::get_config('pve_ckeyring_path');
|
||||||
|
|
||||||
if (! -f $pve_ckeyring_path) {
|
if (! -f $pve_ckeyring_path) {
|
||||||
run_command("ceph-authtool $pve_ckeyring_path --create-keyring " .
|
run_command("ceph-authtool $pve_ckeyring_path --create-keyring " .
|
||||||
"--gen-key -n client.admin");
|
"--gen-key -n client.admin");
|
||||||
|
Loading…
Reference in New Issue
Block a user