Skip to content

Commit

Permalink
Merge pull request #836 from yast/fix-disks-helper
Browse files Browse the repository at this point in the history
Fix disks helper and rules syntax
  • Loading branch information
imobachgs committed May 3, 2022
2 parents 4ea8176 + 90ce5ba commit 24bf433
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
8 changes: 8 additions & 0 deletions package/autoyast2.changes
@@ -1,3 +1,11 @@
-------------------------------------------------------------------
Tue May 3 15:00:22 UTC 2022 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

- Fix detection disk serial and size in the "disks" ERB helper
(bsc#1199000).
- Fix rules validation when using a dialog (bsc#1199165).
- 4.3.102

-------------------------------------------------------------------
Fri Apr 1 06:12:50 UTC 2022 - Imobach Gonzalez Sosa <igonzalezsosa@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.101
Version: 4.3.102
Release: 0
Summary: YaST2 - Automated Installation
License: GPL-2.0-only
Expand Down
7 changes: 3 additions & 4 deletions src/autoyast-rnc/rules.rnc
Expand Up @@ -28,10 +28,9 @@ rule =
element rule {
MAP,
(
y2_match_to+ &
(y2_match_to | dialog)+ &
result &
operator? &
dialog?
operator?
)
}

Expand Down Expand Up @@ -118,7 +117,7 @@ element dialog {
element conflicts {
LIST,
element (element | listentry) { INTEGER }*
}
}?
}

profile =
Expand Down
6 changes: 3 additions & 3 deletions src/lib/autoinstall/y2erb.rb
Expand Up @@ -35,8 +35,8 @@ def disks
udev_names: disk["dev_names"]
}
result[:model] = sys_block_value(dev_name, "device/model") || "Unknown"
result[:serial] = sys_block_value(dev_name, "device/serial") || "Unknown"
result[:size] = (sys_block_value(dev_name, "device/size") || "-1").to_i
result[:serial] = sys_block_value(dev_name, "serial") || "Unknown"
result[:size] = (sys_block_value(dev_name, "size") || "-1").to_i

@disks << result
end
Expand Down Expand Up @@ -111,7 +111,7 @@ def sys_block_value(device, path)
sys_path = "/sys/block/#{device}/"
::File.read(sys_path + path).strip
rescue StandardError => e
log.warn "read of #{sys_path + path} failed with #{e}"
log.warn "read of #{sys_path + path} failed with #{e}"
nil
end
end
Expand Down

0 comments on commit 24bf433

Please sign in to comment.