-
Notifications
You must be signed in to change notification settings - Fork 81
Always insert a 'volume=x' parameter into storage.config #1255
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -815,15 +815,12 @@ sub storage_dot_config_volume_text { | |
my $prefix = shift; | ||
my $letters = shift; | ||
my $volume = shift; | ||
my $has_multiple_volumes = shift; | ||
|
||
my $text = ""; | ||
my @postfix = split( /,/, $letters ); | ||
foreach my $l ( sort @postfix ) { | ||
$text .= $prefix . $l; | ||
if ($has_multiple_volumes) { | ||
$text .= " volume=" . $volume; | ||
} | ||
$text .= " volume=" . $volume; | ||
$text .= "\n"; | ||
} | ||
return $text; | ||
|
@@ -838,24 +835,42 @@ sub storage_dot_config { | |
my $text = $self->header_comment( $server->host_name ); | ||
my $data = $self->param_data( $server, $file ); | ||
|
||
my $has_multiple_volumes = get_num_volumes($data) > 1; | ||
# always default to volume one and let DB params override | ||
my $assigned_volume = 1; | ||
|
||
if ( defined( $data->{Drive_Prefix} ) ) { | ||
if ( defined($data->{Disk_Volume} ) ) { | ||
$assigned_volume = $data->{Disk_Volume}; | ||
} | ||
$text .= storage_dot_config_volume_text( | ||
$data->{Drive_Prefix}, $data->{Drive_Letters}, | ||
$data->{Disk_Volume}, $has_multiple_volumes | ||
$assigned_volume | ||
); | ||
} | ||
|
||
# Default to 2 here | ||
$assigned_volume = 2; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What happens if you have a RAM_Drive_Prefix parameter in the profile but no RAM_Volume parameter, and the Disk_Volume parameter is set to 2? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't the UI prevend that? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should and does are two separate things. These particular configuration items are just parameters in the parameter table that are mapped to a profile. That means there's zero field validation happening; the wild wild west. Anything is possible; they could set RAM_Volume to X if they wanted to. |
||
|
||
if ( defined( $data->{RAM_Drive_Prefix} ) ) { | ||
if ( defined($data->{RAM_Volume} ) ) { | ||
$assigned_volume = $data->{RAM_Volume}; | ||
} | ||
$text .= storage_dot_config_volume_text( | ||
$data->{RAM_Drive_Prefix}, $data->{RAM_Drive_Letters}, | ||
$data->{RAM_Volume}, $has_multiple_volumes | ||
$assigned_volume | ||
); | ||
} | ||
|
||
# ...and default to 3 here | ||
$assigned_volume = 3; | ||
|
||
if ( defined( $data->{SSD_Drive_Prefix} ) ) { | ||
if ( defined($data->{SSD_Volume} ) ) { | ||
$assigned_volume = $data->{SSD_Volume}; | ||
} | ||
$text .= storage_dot_config_volume_text( | ||
$data->{SSD_Drive_Prefix}, $data->{SSD_Drive_Letters}, | ||
$data->{SSD_Volume}, $has_multiple_volumes | ||
$assigned_volume | ||
); | ||
} | ||
return $text; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we increment
$assigned_volume
here, and after we callstorage_dot_config_volume_text
below as well? If we don't, and$data->{RAM_Volume}
or$data->{SSD_Volume}
aren't set but their_Drive_Prefix
is, they'll wrongly get the previously set volume.