chef-ruby-lvm-attrib 0.2.6 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/.expeditor/config.yml +50 -0
  3. data/.expeditor/run_linux_tests.sh +16 -0
  4. data/.expeditor/update_version.sh +12 -0
  5. data/.expeditor/verify.pipeline.yml +19 -0
  6. data/.github/CODEOWNERS +3 -3
  7. data/.github/ISSUE_TEMPLATE/BUG_TEMPLATE.md +29 -0
  8. data/.github/ISSUE_TEMPLATE/DESIGN_PROPOSAL.md +40 -0
  9. data/.github/ISSUE_TEMPLATE/ENHANCEMENT_REQUEST_TEMPLATE.md +17 -0
  10. data/.github/ISSUE_TEMPLATE/SUPPORT_QUESTION.md +12 -0
  11. data/.github/PULL_REQUEST_TEMPLATE.md +1 -0
  12. data/.rubocop.yml +4 -0
  13. data/CHANGELOG.md +43 -3
  14. data/CODE_OF_CONDUCT.md +1 -0
  15. data/CONTRIBUTING.md +1 -0
  16. data/Gemfile +1 -0
  17. data/README.md +3 -1
  18. data/Rakefile +10 -5
  19. data/VERSION +1 -0
  20. data/bin/generate_field_data +68 -45
  21. data/chef-ruby-lvm-attrib.gemspec +2 -2
  22. data/lib/lvm/attributes.rb +2 -2
  23. data/lib/lvm/attributes/2.02.183(2)/lvs.yaml +328 -0
  24. data/lib/lvm/attributes/2.02.183(2)/lvsseg.yaml +138 -0
  25. data/lib/lvm/attributes/2.02.183(2)/pvs.yaml +113 -0
  26. data/lib/lvm/attributes/2.02.183(2)/pvsseg.yaml +16 -0
  27. data/lib/lvm/attributes/2.02.183(2)/vgs.yaml +140 -0
  28. data/lib/lvm/attributes/2.02.185(2)/lvs.yaml +328 -0
  29. data/lib/lvm/attributes/2.02.185(2)/lvsseg.yaml +138 -0
  30. data/lib/lvm/attributes/2.02.185(2)/pvs.yaml +113 -0
  31. data/lib/lvm/attributes/2.02.185(2)/pvsseg.yaml +16 -0
  32. data/lib/lvm/attributes/2.02.185(2)/vgs.yaml +140 -0
  33. data/lib/lvm/attributes/2.02.186(2)/lvs.yaml +328 -0
  34. data/lib/lvm/attributes/2.02.186(2)/lvsseg.yaml +138 -0
  35. data/lib/lvm/attributes/2.02.186(2)/pvs.yaml +113 -0
  36. data/lib/lvm/attributes/2.02.186(2)/pvsseg.yaml +16 -0
  37. data/lib/lvm/attributes/2.02.186(2)/vgs.yaml +140 -0
  38. data/lib/lvm/attributes/2.03.00(2)/lvs.yaml +328 -0
  39. data/lib/lvm/attributes/2.03.00(2)/lvsseg.yaml +138 -0
  40. data/lib/lvm/attributes/2.03.00(2)/pvs.yaml +113 -0
  41. data/lib/lvm/attributes/2.03.00(2)/pvsseg.yaml +16 -0
  42. data/lib/lvm/attributes/2.03.00(2)/vgs.yaml +140 -0
  43. data/lib/lvm/attributes/2.03.01(2)/lvs.yaml +328 -0
  44. data/lib/lvm/attributes/2.03.01(2)/lvsseg.yaml +138 -0
  45. data/lib/lvm/attributes/2.03.01(2)/pvs.yaml +113 -0
  46. data/lib/lvm/attributes/2.03.01(2)/pvsseg.yaml +16 -0
  47. data/lib/lvm/attributes/2.03.01(2)/vgs.yaml +140 -0
  48. data/lib/lvm/attributes/2.03.02(2)/lvs.yaml +328 -0
  49. data/lib/lvm/attributes/2.03.02(2)/lvsseg.yaml +138 -0
  50. data/lib/lvm/attributes/2.03.02(2)/pvs.yaml +113 -0
  51. data/lib/lvm/attributes/2.03.02(2)/pvsseg.yaml +16 -0
  52. data/lib/lvm/attributes/2.03.02(2)/vgs.yaml +140 -0
  53. data/lib/lvm/attributes/2.03.05(2)/lvs.yaml +328 -0
  54. data/lib/lvm/attributes/2.03.05(2)/lvsseg.yaml +138 -0
  55. data/lib/lvm/attributes/2.03.05(2)/pvs.yaml +113 -0
  56. data/lib/lvm/attributes/2.03.05(2)/pvsseg.yaml +16 -0
  57. data/lib/lvm/attributes/2.03.05(2)/vgs.yaml +140 -0
  58. data/lib/lvm/attributes/2.03.08(2)/lvs.yaml +364 -0
  59. data/lib/lvm/attributes/2.03.08(2)/lvsseg.yaml +214 -0
  60. data/lib/lvm/attributes/2.03.08(2)/pvs.yaml +113 -0
  61. data/lib/lvm/attributes/2.03.08(2)/pvsseg.yaml +16 -0
  62. data/lib/lvm/attributes/2.03.08(2)/vgs.yaml +140 -0
  63. data/lib/lvm/attributes/2.03.10(2)/lvs.yaml +364 -0
  64. data/lib/lvm/attributes/2.03.10(2)/lvsseg.yaml +214 -0
  65. data/lib/lvm/attributes/2.03.10(2)/pvs.yaml +113 -0
  66. data/lib/lvm/attributes/2.03.10(2)/pvsseg.yaml +16 -0
  67. data/lib/lvm/attributes/2.03.10(2)/vgs.yaml +140 -0
  68. data/update-lvm.sh +25 -35
  69. metadata +62 -13
  70. data/.github/ISSUE_TEMPLATE.md +0 -13
  71. data/.github/lock.yml +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 19ddd0a5c7e9f01af8a618333e8a0f0aa327e42f572e2dfdf33ffd3a490e096d
4
- data.tar.gz: 2aaa9e40e2c61b544c0a49e51083bd816e6ed45730359675e9017ecbe5eb087a
3
+ metadata.gz: 788fbf6c65d423b8673e4c5d391ce4f18202370c709cafaa285773446ed089a1
4
+ data.tar.gz: 85b491d86608595ae4a250f84ea49f45bdaebaff4661a33499d4e2fb8ee2b178
5
5
  SHA512:
6
- metadata.gz: 69360b1b92e8e7903740c117ef1f0aadd6fd6b4b69b07b15642a42f7017f3a9fb7be9ce4bef939dd63062f76c348a94c0ba1c2c973db0fc46a798934b6a19625
7
- data.tar.gz: 4d45b5991397fc2eaced13a5d011af4f352edb06d9e93469f3feb80c3de899e2b504c4a623af723f29ed6fa2ef5525b60504f1b877c10a65959715af58a0da65
6
+ metadata.gz: 2439db16c40b220cf65ace76c8f3538b01487117b59a029752a446902767d007f93c9f67eb3260b8391463c525e8f6915104dac5bc5a3c06e5fea0dce1e4a9e1
7
+ data.tar.gz: a47aecda90d19ddafca8783c181b3191807b4d7179f53fe5c0156b5d759f48bdad5f59f9ffc3d69ac10265374ca38e7fa399d8a423fc4291b8fe34e1848fc69c
@@ -0,0 +1,50 @@
1
+ # Documentation available at https://expeditor.chef.io/docs/getting-started/
2
+ ---
3
+
4
+ # Slack channel in Chef Software slack to send notifications about build failures, etc
5
+ slack:
6
+ notify_channel: chef-infra-notify
7
+
8
+ # This publish is triggered by the `built_in:publish_rubygems` artifact_action.
9
+ rubygems:
10
+ - chef-ruby-lvm-attrib
11
+
12
+ github:
13
+ # This deletes the GitHub PR branch after successfully merged into the release branch
14
+ delete_branch_on_merge: true
15
+ # The tag format to use (e.g. v1.0.0)
16
+ version_tag_format: "v{{version}}"
17
+ # allow bumping the minor release via label
18
+ minor_bump_labels:
19
+ - "Expeditor: Bump Version Minor"
20
+ # allow bumping the major release via label
21
+ major_bump_labels:
22
+ - "Expeditor: Bump Version Major"
23
+
24
+ changelog:
25
+ rollup_header: Changes not yet released to rubygems.org
26
+
27
+ # These actions are taken, in order they are specified, anytime a Pull Request is merged.
28
+ merge_actions:
29
+ - built_in:bump_version:
30
+ ignore_labels:
31
+ - "Expeditor: Skip Version Bump"
32
+ - "Expeditor: Skip All"
33
+ - bash:.expeditor/update_version.sh:
34
+ only_if: built_in:bump_version
35
+ - built_in:update_changelog:
36
+ ignore_labels:
37
+ - "Expeditor: Skip Changelog"
38
+ - "Expeditor: Skip All"
39
+ - built_in:build_gem:
40
+ only_if: built_in:bump_version
41
+
42
+ pipelines:
43
+ - verify:
44
+ description: Pull Request validation tests
45
+ public: true
46
+
47
+ promote:
48
+ actions:
49
+ - built_in:rollover_changelog
50
+ - built_in:publish_rubygems
@@ -0,0 +1,16 @@
1
+ #!/bin/bash
2
+ #
3
+ # This script runs a passed in command, but first setups up the bundler caching on the repo
4
+
5
+ set -ue
6
+
7
+ export USER="root"
8
+ export LANG=C.UTF-8 LANGUAGE=C.UTF-8
9
+
10
+ echo "--- bundle install"
11
+
12
+ bundle config --local path vendor/bundle
13
+ bundle install --jobs=7 --retry=3
14
+
15
+ echo "+++ bundle exec task"
16
+ bundle exec $@
@@ -0,0 +1,12 @@
1
+ #!/bin/bash
2
+ #
3
+ # After a PR merge, Chef Expeditor will bump the PATCH version in the VERSION file.
4
+ # It then executes this file to update any other files/components with that new version.
5
+ #
6
+
7
+ set -evx
8
+
9
+ sed -i -r "s/^(\s*)VERSION = \".+\"/\1VERSION = \"$(cat VERSION)\"/" lib/lvm/attributes.rb
10
+
11
+ # Once Expeditor finshes executing this script, it will commit the changes and push
12
+ # the commit as a new tag corresponding to the value in the VERSION file.
@@ -0,0 +1,19 @@
1
+ ---
2
+ expeditor:
3
+ cached_folders:
4
+ - vendor
5
+ defaults:
6
+ buildkite:
7
+ retry:
8
+ automatic:
9
+ limit: 1
10
+ timeout_in_minutes: 30
11
+
12
+ steps:
13
+ - label: lint-chefstyle
14
+ command:
15
+ - .expeditor/run_linux_tests.sh "rake style"
16
+ expeditor:
17
+ executor:
18
+ docker:
19
+ image: ruby:2.7-buster
@@ -1,5 +1,5 @@
1
1
  # Order is important. The last matching pattern has the most precedence.
2
2
 
3
- * @chef/client-maintainers
4
- .expeditor/** @chef/jex-team
5
- README.md @chef/docs-team
3
+ * @chef/chef-infra-reviewers @chef/chef-infra-approvers @chef/chef-infra-owners
4
+ .expeditor/ @chef/jex-team
5
+ *.md @chef/docs-team
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: � Bug Report
3
+ about: If something isn't working as expected �.
4
+ labels: "Status: Untriaged"
5
+ ---
6
+
7
+ # Version:
8
+
9
+ [Version of the project installed]
10
+
11
+ # Environment:
12
+
13
+ [Details about the environment such as the Operating System, cookbook details, etc...]
14
+
15
+ # Scenario:
16
+
17
+ [What you are trying to achieve and you can't?]
18
+
19
+ # Steps to Reproduce:
20
+
21
+ [If you are filing an issue what are the things we need to do in order to repro your problem?]
22
+
23
+ # Expected Result:
24
+
25
+ [What are you expecting to happen as the consequence of above reproduction steps?]
26
+
27
+ # Actual Result:
28
+
29
+ [What actually happens after the reproduction steps?]
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: Design Proposal
3
+ about: I have a significant change I would like to propose and discuss before starting
4
+ labels: "Status: Untriaged"
5
+ ---
6
+
7
+ ### When a Change Needs a Design Proposal
8
+
9
+ A design proposal should be opened any time a change meets one of the following qualifications:
10
+
11
+ - Significantly changes the user experience of a project in a way that impacts users.
12
+ - Significantly changes the underlying architecture of the project in a way that impacts other developers.
13
+ - Changes the development or testing process of the project such as a change of CI systems or test frameworks.
14
+
15
+ ### Why We Use This Process
16
+
17
+ - Allows all interested parties (including any community member) to discuss large impact changes to a project.
18
+ - Serves as a durable paper trail for discussions regarding project architecture.
19
+ - Forces design discussions to occur before PRs are created.
20
+ - Reduces PR refactoring and rejected PRs.
21
+
22
+ ---
23
+
24
+ <!--- Proposal description and rationale. -->
25
+
26
+ ## Motivation
27
+
28
+ <!---
29
+ As a <<user_profile>>,
30
+ I want to <<functionality>>,
31
+ so that <<benefit>>.
32
+ -->
33
+
34
+ ## Specification
35
+
36
+ <!--- A detailed description of the planned implementation. -->
37
+
38
+ ## Downstream Impact
39
+
40
+ <!--- Which other tools will be impacted by this work? -->
@@ -0,0 +1,17 @@
1
+ ---
2
+ name: 🚀 Enhancement Request
3
+ about: I have a suggestion (and may want to implement it 🙂)!
4
+ labels: "Status: Untriaged"
5
+ ---
6
+
7
+ ### Describe the Enhancement:
8
+ <!--- What you are trying to achieve that you can't? -->
9
+
10
+ ### Describe the Need:
11
+ <!--- What kind of user do you believe would utilize this enhancement, and how many users might want this functionality -->
12
+
13
+ ### Current Alternative
14
+ <!--- Is there a current alternative that you can utilize to workaround the lack of this enhancement -->
15
+
16
+ ### Can We Help You Implement This?:
17
+ <!--- The best way to ensure your enhancement is built is to help implement the enhancement yourself. If you're interested in helping out we'd love to give you a hand to make this possible. Let us know if there's something you need. -->
@@ -0,0 +1,12 @@
1
+ ---
2
+ name: 🤗 Support Question
3
+ about: If you have a question 💬, please check out our Slack!
4
+ ---
5
+
6
+ We use GitHub issues to track bugs and feature requests. If you need help please post to our Mailing List or join the Chef Community Slack.
7
+
8
+ * Chef Community Slack at http://community-slack.chef.io/.
9
+ * Chef Mailing List https://discourse.chef.io/
10
+
11
+
12
+ Support issues opened here will be closed and redirected to Slack or Discourse.
@@ -12,3 +12,4 @@ StackOverflow discussions that are relevant]
12
12
  - [ ] New functionality includes tests
13
13
  - [ ] All tests pass
14
14
  - [ ] All commits have been signed-off for the Developer Certificate of Origin. See <https://github.com/chef/chef/blob/master/CONTRIBUTING.md#developer-certification-of-origin-dco>
15
+ - [ ] PR title is a worthy inclusion in the CHANGELOG
@@ -0,0 +1,4 @@
1
+ AllCops:
2
+ Exclude:
3
+ - "lvm2/**/*"
4
+ - "vendor/**/*"
@@ -1,11 +1,51 @@
1
+ # chef-ruby-lvm-attrib Changelog
2
+
3
+ <!-- latest_release 0.3.2 -->
4
+ ## [v0.3.2](https://github.com/chef/chef-ruby-lvm-attrib/tree/v0.3.2) (2020-05-27)
5
+
6
+ #### Merged Pull Requests
7
+ - Added v2_03_08 attributes [#27](https://github.com/chef/chef-ruby-lvm-attrib/pull/27) ([gaelik](https://github.com/gaelik))
8
+ <!-- latest_release -->
9
+ <!-- release_rollup since=0.3.1 -->
10
+ ### Changes not yet released to rubygems.org
11
+
12
+ #### Merged Pull Requests
13
+ - Added v2_03_08 attributes [#27](https://github.com/chef/chef-ruby-lvm-attrib/pull/27) ([gaelik](https://github.com/gaelik)) <!-- 0.3.2 -->
14
+ <!-- release_rollup -->
15
+
16
+ <!-- latest_stable_release -->
17
+ ## [v0.3.1](https://github.com/chef/chef-ruby-lvm-attrib/tree/v0.3.1) (2020-04-15)
18
+
19
+ #### Merged Pull Requests
20
+ - Add 2.03.10 data [#25](https://github.com/chef/chef-ruby-lvm-attrib/pull/25) ([tas50](https://github.com/tas50))
21
+ <!-- latest_stable_release -->
22
+
23
+ ## [v0.3.0](https://github.com/chef/chef-ruby-lvm-attrib/tree/v0.3.0) (2019-10-18)
24
+
25
+ #### Merged Pull Requests
26
+ - Wire up Expeditor and Buildkite [#22](https://github.com/chef/chef-ruby-lvm-attrib/pull/22) ([tas50](https://github.com/tas50))
27
+ - Added v2_02_186 attributes [#18](https://github.com/chef/chef-ruby-lvm-attrib/pull/18) ([b-dean](https://github.com/b-dean))
28
+ - Add the gem badge to the readme + resolve chefstyle warnings [#23](https://github.com/chef/chef-ruby-lvm-attrib/pull/23) ([tas50](https://github.com/tas50))
29
+
30
+ # 0.2.8 (2019-08-09)
31
+
32
+ - Added 2.02.185
33
+ - Added 2.03.02
34
+
35
+ # 0.2.7 (2019-01-04)
36
+
37
+ - Added all attributes up to 2.03.01 [@ctramnitz](https://github.com/ctramnitz)
38
+ - Update the updater script to allow for 2.03 versions [@ctramnitz](https://github.com/ctramnitz)
39
+ - Updated the updater script with multiple fixes and improvements [@glensc](https://github.com/glensc)
40
+
1
41
  # 0.2.6 (2018-11-02)
2
42
 
3
- - Added attributes 2.02.178(2) to 2.02.182(2)
43
+ - Added attributes for 2.02.178(2), 2.02.178(2)-rc1, 2.02.179(2), 2.02.180(2), 2.02.181(2), 2.02.182(2)
4
44
  - Reworked the tooling to generate the attributes to work with the new format
5
45
 
6
46
  # 0.2.5 (2018-11-01)
7
47
 
8
- - Added v2_02_180 attributes
48
+ - This release is broken and has no changes.
9
49
 
10
50
  # 0.2.4 (2018-06-29)
11
51
 
@@ -141,4 +181,4 @@
141
181
 
142
182
  - Added LVM attributes for version 2.02.111
143
183
  - Added MIT license to the Gemspec
144
- - Gemspec now properly loads the version from the lib/attributes.rb file
184
+ - Gemspec now properly loads the version from the lib/attributes.rb file
@@ -0,0 +1 @@
1
+ Please refer to the Chef Community Code of Conduct at https://www.chef.io/code-of-conduct/
@@ -0,0 +1 @@
1
+ Please refer to https://github.com/chef/chef/blob/master/CONTRIBUTING.md
data/Gemfile CHANGED
@@ -4,4 +4,5 @@ gemspec
4
4
 
5
5
  group :development do
6
6
  gem "chefstyle"
7
+ gem "rake"
7
8
  end
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # chef-ruby-lvm-attrib
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/chef-ruby-lvm-attrib.svg)](https://badge.fury.io/rb/chef-ruby-lvm-attrib)
4
+
3
5
  This is a list of attributes for lvm objects. They are generated from the source code and broken down by version. See ADDING ATTRIBUTES below to contribute.
4
6
 
5
7
  At their core these files exist to determine which arguments to pass lvs/vgs/pvs and the subsequent type conversions.
@@ -21,7 +23,7 @@ Currently this is split from the main ruby-lvm gem since these files require upd
21
23
  ## Installation
22
24
 
23
25
  ```bash
24
- sudo gem install ruby-lvm-attrib
26
+ sudo gem install chef-ruby-lvm-attrib
25
27
  ```
26
28
 
27
29
  ## Updating for new LVM releases
data/Rakefile CHANGED
@@ -1,9 +1,14 @@
1
1
  require "bundler/gem_tasks"
2
2
 
3
- task :default => :style
3
+ task default: :style
4
4
 
5
- require "chefstyle"
6
- require "rubocop/rake_task"
7
- RuboCop::RakeTask.new(:style) do |task|
8
- task.options += ["--display-cop-names", "--no-color"]
5
+ begin
6
+ require "chefstyle"
7
+ require "rubocop/rake_task"
8
+ desc "Run Chefstyle tests"
9
+ RuboCop::RakeTask.new(:style) do |task|
10
+ task.options += ["--display-cop-names", "--no-color"]
11
+ end
12
+ rescue LoadError
13
+ puts "chefstyle gem is not installed. bundle install first to make sure all dependencies are installed."
9
14
  end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.3.2
@@ -8,8 +8,8 @@
8
8
  require "fileutils"
9
9
  require "yaml"
10
10
 
11
- VERSION_FILE = "/VERSION"
12
- COLUMNS_FILE = "/lib/report/columns.h"
11
+ VERSION_FILE = "/VERSION".freeze
12
+ COLUMNS_FILE = "/lib/report/columns.h".freeze
13
13
 
14
14
  debug = false
15
15
 
@@ -70,7 +70,6 @@ TYPE_CONVERSION_MAP = {
70
70
  "raidminrecoveryrate" => "Integer",
71
71
  "raidmaxrecoveryrate" => "Integer",
72
72
  "segsizepe" => "Integer",
73
- "thinid" => "Integer",
74
73
  # New fields for caching
75
74
  "cache_total_blocks" => "Integer",
76
75
  "cache_used_blocks" => "Integer",
@@ -92,7 +91,29 @@ TYPE_CONVERSION_MAP = {
92
91
  "seg_new_data_offset" => "Integer",
93
92
  "seg_parity_chunks" => "Integer",
94
93
  "cachemetadataformat" => "Integer",
95
- }
94
+
95
+ # these seems to be integers
96
+ "vdo_used_size" => "Integer",
97
+ "vdo_saving_percent" => "Integer",
98
+ "writecache_total_blocks" => "Integer",
99
+ "writecache_free_blocks" => "Integer",
100
+ "writecache_writeback_blocks" => "Integer",
101
+ "writecache_error" => "Integer",
102
+ "vdo_minimum_io_size" => "Integer",
103
+ "vdo_block_map_cache_size" => "Integer",
104
+ "vdo_block_map_era_length" => "Integer",
105
+ "vdo_index_memory_size" => "Integer",
106
+ "vdo_slab_size" => "Integer",
107
+ "vdo_ack_threads" => "Integer",
108
+ "vdo_bio_threads" => "Integer",
109
+ "vdo_bio_rotation" => "Integer",
110
+ "vdo_cpu_threads" => "Integer",
111
+ "vdo_hash_zone_threads" => "Integer",
112
+ "vdo_logical_threads" => "Integer",
113
+ "vdo_physical_threads" => "Integer",
114
+ "vdo_max_discard" => "Integer",
115
+ "vdo_header_size" => "Integer",
116
+ }.freeze
96
117
 
97
118
  lvm_source = ARGV[0]
98
119
 
@@ -105,12 +126,13 @@ pvssegs = []
105
126
  vgs = []
106
127
  File.readlines(lvm_source + COLUMNS_FILE).each do |line|
107
128
  # eg: FIELD(LVS, lv, STR, "LV UUID", lvid.id[1], 38, uuid, "lv_uuid", "Unique identifier")
108
- next unless line =~ %r{^FIELD\((.*)\)$}
129
+ next unless line =~ /^FIELD\((.*)\)$/
130
+
109
131
  fields = $1.split(", ")
110
- fields.each { |f| f.gsub!(%r{^"}, ""); f.gsub!(%r{"$}, "") }
132
+ fields.each { |f| f.gsub!(/^"/, ""); f.gsub!(/"$/, "") }
111
133
  p fields if debug
112
- app = fields[0]
113
- general_type = fields[2]
134
+ app = fields[0]
135
+ general_type = fields[2]
114
136
  specific_type = fields[6]
115
137
  column = fields[7]
116
138
  method = fields[7].dup
@@ -133,24 +155,24 @@ File.readlines(lvm_source + COLUMNS_FILE).each do |line|
133
155
  # with issues (seg_start).
134
156
  case app
135
157
  when "LVS", "LVSINFOSTATUS", "LVSSTATUS"
136
- method.sub!(%r{^lv_}, "")
158
+ method.sub!(/^lv_/, "")
137
159
  when "SEGS"
138
- method.sub!(%r{^seg_}, "")
160
+ method.sub!(/^seg_/, "")
139
161
  when "LABEL"
140
- method.sub!(%r{^pv_}, "")
162
+ method.sub!(/^pv_/, "")
141
163
  when "PVS"
142
- method.sub!(%r{^pv_}, "")
164
+ method.sub!(/^pv_/, "")
143
165
  when "PVSEGS"
144
- method.sub!(%r{^pvseg_}, "")
166
+ method.sub!(/^pvseg_/, "")
145
167
  when "VGS"
146
- method.sub!(%r{^vg_}, "")
168
+ method.sub!(/^vg_/, "")
147
169
  end
148
170
 
149
171
  attribute = {
150
- :method => method,
151
- :column => column,
152
- :type_hint => attribute_type,
153
- :description => description,
172
+ method: method,
173
+ column: column,
174
+ type_hint: attribute_type,
175
+ description: description,
154
176
  }
155
177
 
156
178
  case app
@@ -170,27 +192,27 @@ File.readlines(lvm_source + COLUMNS_FILE).each do |line|
170
192
  end
171
193
 
172
194
  # we use vg_uuid as our crossover attribute that links vg->lv and vg->pv
173
- attribute = { :method => "vg_uuid",
174
- :column => "vg_uuid",
175
- :type_hint => "String",
176
- :description => "For VolumeGroup to LogicalVolume relationship." }
195
+ attribute = { method: "vg_uuid",
196
+ column: "vg_uuid",
197
+ type_hint: "String",
198
+ description: "For VolumeGroup to LogicalVolume relationship." }
177
199
  lvs << attribute
178
- attribute = { :method => "vg_uuid",
179
- :column => "vg_uuid",
180
- :type_hint => "String",
181
- :description => "For VolumeGroup to PhysicalVolume relationship." }
200
+ attribute = { method: "vg_uuid",
201
+ column: "vg_uuid",
202
+ type_hint: "String",
203
+ description: "For VolumeGroup to PhysicalVolume relationship." }
182
204
  pvs << attribute
183
205
 
184
206
  # and we link lv->lvsegment, pv->pvsegment
185
- attribute = { :method => "lv_uuid",
186
- :column => "lv_uuid",
187
- :type_hint => "String",
188
- :description => "For LogicalVolume to LogicalVolumeSegment relationship." }
207
+ attribute = { method: "lv_uuid",
208
+ column: "lv_uuid",
209
+ type_hint: "String",
210
+ description: "For LogicalVolume to LogicalVolumeSegment relationship." }
189
211
  lvssegs << attribute
190
- attribute = { :method => "pv_uuid",
191
- :column => "pv_uuid",
192
- :type_hint => "String",
193
- :description => "For PhysicalVolume to PhysicalVolumeSegment relationship." }
212
+ attribute = { method: "pv_uuid",
213
+ column: "pv_uuid",
214
+ type_hint: "String",
215
+ description: "For PhysicalVolume to PhysicalVolumeSegment relationship." }
194
216
  pvssegs << attribute
195
217
 
196
218
  lvs.sort! { |x, y| x[:column] <=> y[:column] }
@@ -199,18 +221,19 @@ pvs.sort! { |x, y| x[:column] <=> y[:column] }
199
221
  pvssegs.sort! { |x, y| x[:column] <=> y[:column] }
200
222
  vgs.sort! { |x, y| x[:column] <=> y[:column] }
201
223
 
202
- FileUtils.mkdir(version)
224
+ attributes_dir = "lib/lvm/attributes/#{version}"
225
+ FileUtils.mkdir(attributes_dir)
203
226
 
204
- disclaimer = <<go
205
- # These are column to object attribute mappings
206
- # generated by #{$0} based on
207
- # #{lvm_source}/lib/report/columns.h
208
- go
227
+ disclaimer = <<~GO
228
+ # These are column to object attribute mappings
229
+ # generated by #{$0} based on
230
+ # #{lvm_source}/lib/report/columns.h
231
+ GO
209
232
 
210
- File.open("#{version}/lvs.yaml", "w") { |f| f.write(disclaimer); f.write(lvs.to_yaml) }
211
- File.open("#{version}/lvsseg.yaml", "w") { |f| f.write(disclaimer); f.write(lvssegs.to_yaml) }
212
- File.open("#{version}/pvs.yaml", "w") { |f| f.write(disclaimer); f.write(pvs.to_yaml) }
213
- File.open("#{version}/pvsseg.yaml", "w") { |f| f.write(disclaimer); f.write(pvssegs.to_yaml) }
214
- File.open("#{version}/vgs.yaml", "w") { |f| f.write(disclaimer); f.write(vgs.to_yaml) }
233
+ File.open("#{attributes_dir}/lvs.yaml", "w") { |f| f.write(disclaimer); f.write(lvs.to_yaml) }
234
+ File.open("#{attributes_dir}/lvsseg.yaml", "w") { |f| f.write(disclaimer); f.write(lvssegs.to_yaml) }
235
+ File.open("#{attributes_dir}/pvs.yaml", "w") { |f| f.write(disclaimer); f.write(pvs.to_yaml) }
236
+ File.open("#{attributes_dir}/pvsseg.yaml", "w") { |f| f.write(disclaimer); f.write(pvssegs.to_yaml) }
237
+ File.open("#{attributes_dir}/vgs.yaml", "w") { |f| f.write(disclaimer); f.write(vgs.to_yaml) }
215
238
 
216
239
  puts "Done."