Skip to content

Commit

Permalink
Merge pull request #728 from ancorgs/fstopt
Browse files Browse the repository at this point in the history
AutoYaST UI: fix field fstopt in partitioning (bsc#1181577)
  • Loading branch information
ancorgs committed Feb 1, 2021
2 parents b38c94a + 109213b commit 9685ab5
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 10 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:

- name: Git Checkout
uses: actions/checkout@v1
uses: actions/checkout@v2

# just for easier debugging...
- name: Inspect Installed Packages
Expand All @@ -38,7 +38,7 @@ jobs:
steps:

- name: Git Checkout
uses: actions/checkout@v1
uses: actions/checkout@v2

- name: Rubocop
run: rake check:rubocop
Expand All @@ -50,7 +50,7 @@ jobs:
steps:

- name: Git Checkout
uses: actions/checkout@v1
uses: actions/checkout@v2

- name: Package Build
run: yast-ci-ruby -o package
Expand All @@ -62,7 +62,7 @@ jobs:
steps:

- name: Git Checkout
uses: actions/checkout@v1
uses: actions/checkout@v2

- name: Yardoc
run: rake check:doc
Expand All @@ -76,7 +76,7 @@ jobs:
steps:

- name: Git Checkout
uses: actions/checkout@v1
uses: actions/checkout@v2

- name: Perl Syntax
run: yast-ci-ruby -o perl_syntax
Expand Down
7 changes: 7 additions & 0 deletions package/autoyast2.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Feb 1 09:09:15 UTC 2021 - Ancor Gonzalez Sosa <ancor@suse.com>

- AutoYaST UI: fixed field Mount Options (fstopt) in the
partitioning section (bsc#1181577).
- 4.3.67

-------------------------------------------------------------------
Thu Jan 28 16:54:47 UTC 2021 - Ancor Gonzalez Sosa <ancor@suse.com>

Expand Down
2 changes: 1 addition & 1 deletion package/autoyast2.spec
Expand Up @@ -22,7 +22,7 @@
%endif

Name: autoyast2
Version: 4.3.66
Version: 4.3.67
Release: 0
Summary: YaST2 - Automated Installation
License: GPL-2.0-only
Expand Down
26 changes: 26 additions & 0 deletions src/lib/autoinstall/presenters/partition.rb
Expand Up @@ -84,6 +84,18 @@ def drive_type
drive_presenter.type
end

# String representation of #fstab_options
#
# The field is actually called fstopt in the AutoYaST xml and treated like a plain string,
# so this method provides a more direct communication between the profile and the current
# UI (which also uses a plain InputField).
#
# @return [String, nil] nil if there are no fstab_options (which is consistent with the
# behavior of all other attributes of Y2Storage::AutoinstProfile::PartitionSection)
def fstopt
fstab_options&.join(",")
end

# Whether the section is an LVM Logical Volume
#
# @return [Boolean] true when belongs to an LVM drive; false otherwise
Expand Down Expand Up @@ -232,6 +244,20 @@ def device_type_no_partitions

:none
end

# @see Section#clean_section
def clean_section(attrs)
# "fstopt" is the right key to use as part of the hash received by
# Y2Storage::AutoinstProfile::PartitionSection.init_from_hashes,
# but the corresponding attribute in that class is called #fstab_options
new_attrs =
if attrs.include?("fstopt")
attrs - ["fstopt"] + ["fstab_options"]
else
attrs
end
super(new_attrs)
end
end
end
end
4 changes: 2 additions & 2 deletions src/lib/autoinstall/widgets/storage/filesystem_attrs.rb
Expand Up @@ -70,7 +70,7 @@ def init
label_widget.value = section.label
mount_point_widget.value = section.mount
mountby_widget.value = section.mountby
fstab_options_widget.value = section.fstab_options
fstab_options_widget.value = section.fstopt
mkfs_options_widget.value = section.mkfs_options
create_subvolumes_widget.value = section.create_subvolumes

Expand All @@ -86,7 +86,7 @@ def values
"label" => label_widget.value,
"mount" => mount_point_widget.value,
"mountby" => mountby_widget.value,
"fstab_options" => fstab_options_widget.value,
"fstopt" => fstab_options_widget.value,
"mkfs_options" => mkfs_options_widget.value,
"create_subvolumes" => btrfs? ? create_subvolumes_widget.value : nil
}
Expand Down
3 changes: 2 additions & 1 deletion test/lib/widgets/storage/filesystem_attrs_test.rb
Expand Up @@ -144,7 +144,8 @@
end

it "includes fstab options" do
expect(widget.values).to include("fstab_options" => "ro,noatime,user")
# See bsc#1181577, the correct name in this hash is fstopt (not fstab_options)
expect(widget.values).to include("fstopt" => "ro,noatime,user")
end
end
end
3 changes: 2 additions & 1 deletion test/lib/widgets/storage/partition_usage_tab_test.rb
Expand Up @@ -145,13 +145,14 @@

describe "#store" do
it "sets section attributes related to its usage" do
# See bsc#1181577, the correct name in this hash is fstopt (not fstab_options)
expect(partition).to receive(:update).with(
hash_including(
"filesystem",
"label",
"mount",
"mountby",
"fstab_options",
"fstopt",
"mkfs_options",
"raid_name",
"lvm_group",
Expand Down

0 comments on commit 9685ab5

Please sign in to comment.