mirror of
https://git.proxmox.com/git/pve-installer
synced 2025-04-28 14:55:03 +00:00
iso env: add singleton getter
this is basically global state, so don't bend overt backwards in passing it around, just access it wherever.. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
ddd96e5cb9
commit
ad9ef5e7fb
@ -147,6 +147,12 @@ sub setup {
|
||||
return $env;
|
||||
}
|
||||
|
||||
my $_env = undef;
|
||||
sub get {
|
||||
$_env = setup() if !defined($_env);
|
||||
return $_env;
|
||||
}
|
||||
|
||||
my $test_images;
|
||||
# sets a test image to use as disk and enables the testmode
|
||||
sub set_test_image {
|
||||
|
@ -40,7 +40,7 @@ if (!$ENV{G_SLICE} || $ENV{G_SLICE} ne "always-malloc") {
|
||||
Proxmox::Install::ISOEnv::set_test_image($test_image) if $test_image;
|
||||
}
|
||||
|
||||
my $iso_env = Proxmox::Install::ISOEnv::setup();
|
||||
my $iso_env = Proxmox::Install::ISOEnv::get(); # init singleton
|
||||
my $run_env = Proxmox::Install::RunEnv::query_installation_environment();
|
||||
|
||||
my $zfstestpool = "test_rpool";
|
||||
|
Loading…
Reference in New Issue
Block a user