manageiq-smartstate 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6eb99759a729e78c638ca24d3d18d0e56fb85e87cd69ddd962087ec4b12cd734
4
- data.tar.gz: 311f7086a407f541ec64b3380cff54b9b011a4fad2234cb9fef01fda488669ce
3
+ metadata.gz: d28b6b5963e7251ee987bba32b6136a49cff81afe1fbb5f6129661d3ee9ee129
4
+ data.tar.gz: df79d4b387ac5ba5738e9886f49f461fb77d4c80f6e36b310b36e2fc61adc77e
5
5
  SHA512:
6
- metadata.gz: '08c48060bd2cf691c32fab0ed798971dc3d6f49e2cf2bfc1575e636b08bea8d5cbfd2ee7096c8a0b6ec83a40bc1f5ea86f2f008e8767867589750f35ed1035a2'
7
- data.tar.gz: 8e244a6f579ad84c7796a96de17ed12b4da3ba70bdb910113abbb88bc5866b001edb3abbbe52f493d31a9215c04e9221282319e353497bd8ee929caf28f99711
6
+ metadata.gz: 8823628b1fb83a33b03dac60e53567e2228bb1da257d091d8914441aa88835ef43f77314f5954231efe434c7ee059a0484d34e2c6d2346e62c59fbcaf4e91251
7
+ data.tar.gz: ceeb25ce2aea2280f71e1d53debe1bf493e8e3fb50de18a070585c4668d301c5292814cf759dbb1c834f202ab650b304a6a3ffba3b795b9ee12c0cb33338757b
data/.codeclimate.yml CHANGED
@@ -17,7 +17,7 @@ plugins:
17
17
  rubocop:
18
18
  enabled: true
19
19
  config: ".rubocop_cc.yml"
20
- channel: rubocop-0-82
20
+ channel: rubocop-1-56-3
21
21
  brakeman:
22
22
  enabled: false
23
23
  bundler-audit:
@@ -28,4 +28,4 @@ jobs:
28
28
  - name: Report code coverage
29
29
  if: "${{ github.ref == 'refs/heads/master' && matrix.ruby-version == '3.0' }}"
30
30
  continue-on-error: true
31
- uses: paambaati/codeclimate-action@v5
31
+ uses: paambaati/codeclimate-action@v8
data/.whitesource CHANGED
@@ -1,3 +1,3 @@
1
1
  {
2
2
  "settingsInheritedFrom": "ManageIQ/whitesource-config@master"
3
- }
3
+ }
@@ -1,3 +1,4 @@
1
+ require 'awesome_spawn'
1
2
  require 'MiqVm/MiqVm'
2
3
 
3
4
  class MiqRhevmVm < MiqVm
@@ -51,12 +52,17 @@ class MiqRhevmVm < MiqVm
51
52
  storage_obj = storage_domains_by_id[storage_id]
52
53
 
53
54
  file_path = file_path_for_storage_type(storage_obj, disk)
55
+ file_path_s = file_path.to_s
54
56
 
55
57
  tag = "scsi0:#{idx}"
56
58
  cfg_hash["#{tag}.present"] = "true"
57
59
  cfg_hash["#{tag}.devicetype"] = "disk"
58
- cfg_hash["#{tag}.filename"] = file_path.to_s
60
+ cfg_hash["#{tag}.filename"] = file_path_s
59
61
  cfg_hash["#{tag}.format"] = disk.format
62
+
63
+ if storage_type_block?(storage_obj.storage.type) && !lv_active?(file_path_s)
64
+ AwesomeSpawn.run!("sudo lvchange", :params => [:activate, "y", file_path_s])
65
+ end
60
66
  end
61
67
  cfg_hash
62
68
  end
@@ -65,8 +71,7 @@ class MiqRhevmVm < MiqVm
65
71
  storage_type = storage_obj&.storage&.type
66
72
 
67
73
  # TODO: account for other storage types here.
68
- case storage_type
69
- when "nfs", "glusterfs"
74
+ if storage_type_file?(storage_type)
70
75
  add_fs_mount(storage_obj)
71
76
  fs_file_path(storage_obj, disk)
72
77
  else
@@ -177,4 +182,19 @@ class MiqRhevmVm < MiqVm
177
182
  $log.warn "#{log_header} Failed to unmount all items from <#{nfs_mount_root}>. Reason: <#{$!}>"
178
183
  end
179
184
  end
185
+
186
+ private
187
+
188
+ # Output attributes of LV in column format and parse to retrieve active status
189
+ def lv_active?(lv_path)
190
+ AwesomeSpawn.run!("sudo lvs", :params => [:noheadings, :o, "lv_active", lv_path]).output.strip == "active"
191
+ end
192
+
193
+ def storage_type_block?(storage_type)
194
+ ["ISCSI", "FCP"].include?(storage_type.upcase)
195
+ end
196
+
197
+ def storage_type_file?(storage_type)
198
+ ["NFS", "GLUSTERFS"].include?(storage_type.upcase)
199
+ end
180
200
  end
@@ -1,5 +1,5 @@
1
1
  module ManageIQ
2
2
  module Smartstate
3
- VERSION = "0.9.0".freeze
3
+ VERSION = "0.10.0".freeze
4
4
  end
5
5
  end
data/renovate.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
+ "extends": [
4
+ "config:recommended"
5
+ ]
6
+ }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: manageiq-smartstate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ManageIQ Developers
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-02-21 00:00:00.000000000 Z
11
+ date: 2024-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -574,6 +574,7 @@ files:
574
574
  - lib/tasks/azure.rake
575
575
  - log/.gitkeep
576
576
  - manageiq-smartstate.gemspec
577
+ - renovate.json
577
578
  homepage: https://github.com/ManageIQ/manageiq-smartstate
578
579
  licenses:
579
580
  - Apache-2.0