storazzo 0.5.1 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +7 -5
- data/LICENSE +20 -1
- data/Makefile +9 -5
- data/Rakefile +22 -9
- data/VERSION +1 -1
- data/bin/hello-storazzo +1 -0
- data/bin/ricdisk-magic +33 -30
- data/bin/stats-with-md5 +146 -176
- data/bin/storazzo +158 -0
- data/bin/storazzo-symlink.rb +1 -0
- data/bin/storazzo-util +1 -0
- data/lib/storazzo/colors.rb +77 -36
- data/lib/storazzo/common.rb +72 -65
- data/lib/storazzo/debug.rb +2 -0
- data/lib/storazzo/hashify.rb +7 -5
- data/lib/storazzo/main.rb +59 -49
- data/lib/storazzo/media/abstract_ric_disk.rb +190 -161
- data/lib/storazzo/media/gcs_bucket.rb +78 -47
- data/lib/storazzo/media/local_folder.rb +56 -42
- data/lib/storazzo/media/mount_point.rb +22 -6
- data/lib/storazzo/ric_disk.rb +386 -383
- data/lib/storazzo/ric_disk_config.rb +229 -197
- data/lib/storazzo/ric_disk_sample_config.rb +26 -24
- data/lib/storazzo/ric_disk_statsfile.rb +19 -17
- data/lib/storazzo/ric_disk_ugly.rb +1 -0
- data/lib/storazzo/version.rb +3 -3
- data/lib/storazzo.rb +6 -7
- data/storazzo.gemspec +31 -19
- data/test/benchmark/for_future_use.rb +15 -0
- data/test/benchmark/test_hashing_functions-speed.rb +17 -0
- data/test/bin/new-idea.rb +17 -0
- data/test/bin/storazzo.rb +25 -0
- data/test/media/test_abstract_ric_disk.rb +6 -4
- data/test/media/test_gcs_bucket.rb +55 -21
- data/test/media/test_local_folder.rb +28 -29
- data/test/media/test_mount_point.rb +7 -5
- data/test/test_ric_disk.rb +8 -6
- data/test/test_ric_disk_config.rb +13 -12
- data/test/test_ric_disk_stats_file.rb +5 -3
- data/test/test_storazzo.rb +6 -4
- data/var/test/disks/disk02-full/Rakefile +7 -5
- data/var/test/disks/ricdisk_stats_v11.rds +11 -22
- metadata +22 -22
@@ -1,165 +1,194 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# require "storazzo/ric_disk/abstract_ric_disk"
|
4
|
+
# require "storazzo/ric_disk/gcs_bucket"
|
5
|
+
# require "gcs_bucket"
|
6
|
+
# require "abstract_ric_disk"
|
7
|
+
|
8
|
+
# This class is an Abstract Class which forces its 3 inquilines to implement
|
9
|
+
# a number of functions, namely:
|
10
|
+
#
|
11
|
+
# def self.list_all()
|
12
|
+
# def self.list_all_with_type()
|
13
|
+
#
|
14
|
+
# Note this needs to work without weird overrides, like:
|
15
|
+
#
|
16
|
+
# def self.list_all_with_type(config=nil) # BAD
|
17
|
+
# def self.list_all_with_type() # GOOD
|
18
|
+
#
|
19
|
+
#
|
20
|
+
|
21
|
+
module Storazzo
|
22
|
+
module Media
|
23
|
+
module Storazzo
|
24
|
+
module Media
|
25
|
+
class AbstractRicDisk
|
26
|
+
# include Storazzo::Common
|
27
|
+
extend Storazzo::Common
|
28
|
+
|
29
|
+
# DefaultStatsFilename = Storazzo::RicDiskStatsFile.default_name
|
30
|
+
|
31
|
+
# looks like there's not Abstract Class in Ruby, but also SO says he best
|
32
|
+
# way to do this is this:
|
33
|
+
|
34
|
+
# attr_accessor :name, :description, :ricdisk_file, :local_mountpoint, :wr, :path, :ricdisk_file_empty, :size, :active_dirs
|
35
|
+
attr_accessor :description
|
36
|
+
|
37
|
+
########################
|
38
|
+
# Abstract methods START
|
39
|
+
########################
|
40
|
+
def initialize(_local_mount)
|
41
|
+
deb "[AbstractRicDisk.init()] Some child of AbstractRicDisk (#{self}) called me! Yummie." # disable when you dont need me anymore..
|
42
|
+
@description ||= 'Not provided'
|
43
|
+
# validate
|
44
|
+
end
|
45
|
+
|
46
|
+
def self.list_all
|
47
|
+
raise "[AbstractRicDiskc::self.list_all] You should override this, says StackOverflow and Riccardo. Class=#{self.class}. Self=#{self}"
|
48
|
+
end
|
49
|
+
|
50
|
+
def self.list_all_with_type
|
51
|
+
raise "[AbstractRicDisk::self.list_all_with_type] You should override this, says StackOverflow and Riccardo. Class=#{self.class}. Self=#{self}"
|
52
|
+
end
|
53
|
+
|
54
|
+
def self.super_duper_list_all_with_type
|
55
|
+
deb 'Would be cool to be able to enumerate them all..'
|
56
|
+
GcsBucket.list_all_with_type +
|
57
|
+
MountPoint.list_all_with_type +
|
58
|
+
LocalFolder.list_all_with_type
|
59
|
+
end
|
60
|
+
|
61
|
+
def parse(_opts = {})
|
62
|
+
raise "[AbstractRicDiskc::parse] You should override this, says StackOverflow and Riccardo. Class=#{self.class}."
|
63
|
+
end
|
64
|
+
|
65
|
+
def writeable?
|
66
|
+
raise "[AbstractRicDiskc::writeable] You should override this in class=#{self.class}, says StackOverflow and Riccardo"
|
67
|
+
end
|
68
|
+
|
69
|
+
def get_local_mountpoint
|
70
|
+
# raise "[AbstractRicDiskc::get_local_mountpoint] You should override this, says StackOverflow and Riccardo"
|
71
|
+
raise 'You forgot to set local_mountpoint in the constructor for your class, you cheeky little one!' if local_mountpoint.nil?
|
72
|
+
|
73
|
+
local_mountpoint
|
74
|
+
end
|
75
|
+
|
76
|
+
def check_implemented_correctly
|
77
|
+
# raise "[AbstractRicDiskc] You should override this, says StackOverflow and Riccardo"
|
78
|
+
raise 'no @local_mountpoint' unless exists?(@local_mountpoint)
|
79
|
+
end
|
80
|
+
########################
|
81
|
+
# Abstract methods END
|
82
|
+
########################
|
83
|
+
|
84
|
+
########################
|
85
|
+
# Automated methods now...
|
86
|
+
########################
|
87
|
+
# stats_file_default_location()
|
88
|
+
def stats_file_smart_fullpath
|
89
|
+
# if its writeable... if not we'll think about it later.
|
90
|
+
if writeable?
|
91
|
+
"#{get_local_mountpoint}/#{default_stats_filename}"
|
92
|
+
else
|
93
|
+
# if not writeable, I will:
|
94
|
+
# 1. create a dir based on its unique format.
|
95
|
+
# 2. create a file of same look and feel (alternative - used a DASH)
|
96
|
+
"TODO FIXME {get_local_folder}/#{unique_id}::#{default_stats_filename}"
|
97
|
+
# "{get_local_folder}"/#{unique_id}/#{Storazzo::RicDiskStatsFile.default_name}"
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
# Needs to be some unique id based on its thingy, but might change in the future:
|
102
|
+
# Solutions:
|
103
|
+
# {PHILOSOPHY}::{ID}
|
104
|
+
def unique_id
|
105
|
+
# Expand path to make it as unique as possible...
|
106
|
+
hash = Digest::MD5.hexdigest(File.expand_path(get_local_mountpoint))
|
107
|
+
"MD5::v1::#{hash}"
|
108
|
+
end
|
109
|
+
|
110
|
+
def to_s(verbose = false)
|
111
|
+
return to_verbose_s if verbose
|
112
|
+
|
113
|
+
readable_class = self.class.to_s.split('::').last # Storazzo::Media::LocalFolder => LocalFolder
|
114
|
+
my_keys = instance_variables # wow!
|
115
|
+
"S:M:#{readable_class}(path=#{path}, r/w=#{wr}, keys=#{my_keys})"
|
116
|
+
end
|
117
|
+
|
118
|
+
def to_verbose_s
|
119
|
+
h = {}
|
120
|
+
h[:class] = self.class
|
121
|
+
h[:unique_id] = unique_id
|
122
|
+
h[:inspect] = inspect
|
123
|
+
h[:to_s] = to_s
|
124
|
+
h[:local_mountpoint] = local_mountpoint
|
125
|
+
h[:writeable] = writeable?
|
126
|
+
h[:stats_file_smart_fullpath] = stats_file_smart_fullpath
|
127
|
+
h
|
128
|
+
end
|
129
|
+
|
130
|
+
# # Todo check on instances these 3 methods exist
|
131
|
+
def self.abstract_class_mandatory_methods
|
132
|
+
%w[
|
133
|
+
self.list_all
|
134
|
+
self.list_all_with_type
|
135
|
+
local_mountpoint
|
136
|
+
parse
|
137
|
+
writeable?
|
138
|
+
]
|
139
|
+
end
|
140
|
+
|
141
|
+
# Putting here since its same code for MountPoint or generic folder.
|
142
|
+
def parse_block_storage_folder(opts = {})
|
143
|
+
# Storazzo::RicDiskUgly.calculate_stats_files(get_local_mountpoint)
|
144
|
+
rd = Storazzo::RicDisk.new(self)
|
145
|
+
# Storazzo::RicDisk
|
146
|
+
rd.compute_stats_files(opts)
|
147
|
+
# return "42"
|
148
|
+
end
|
149
|
+
|
150
|
+
def self.default_stats_filename
|
151
|
+
raise 'Unknown Storazzo::RicDiskStatsFile.default_name 1!!' if Storazzo::RicDiskStatsFile.default_name.nil?
|
152
|
+
|
153
|
+
Storazzo::RicDiskStatsFile.default_name
|
154
|
+
end
|
155
|
+
|
156
|
+
# if not writeable we need to pick another from stats_file_smart_fullpath()
|
157
|
+
def stats_filename_default_fullpath
|
158
|
+
# REDUNDANT, should use stats_file_smart_fullpath instead except on the writeable? part since it would go recursive otherwise.
|
159
|
+
my_stats_filename = default_stats_filename
|
160
|
+
# raise "Unknown Storazzo::RicDiskStatsFile.default_name 2 !!" if Storazzo::RicDiskStatsFile.default_name.nil?
|
161
|
+
"#{local_mountpoint}/#{my_stats_filename}"
|
162
|
+
end
|
163
|
+
|
164
|
+
def validate(opts = {})
|
165
|
+
opt_verbose = opts.fetch :verbose, false
|
166
|
+
pverbose opt_verbose,
|
167
|
+
"validate(): [BROKEN] We're trying to see if your object is valid, across 3 possible sub-classes."
|
168
|
+
# 1. check for
|
169
|
+
raise 'Unknown local mount ' unless local_mount.is_a?(String)
|
170
|
+
|
171
|
+
# 2. check thaty writeable? is true or false
|
172
|
+
my_writeable = wr
|
173
|
+
raise 'Writeable is not boolean' unless my_writeable.is_a?(TrueClass) || my_writeable.is_a?(FalseClass)
|
174
|
+
end
|
175
|
+
|
176
|
+
# TODO: use a proper Factory pattern.
|
177
|
+
def self.DirFactory(path)
|
178
|
+
raise "I need a path/directory string: #{path}" unless path.is_a?(String)
|
179
|
+
|
180
|
+
deb 'TODO: if coincides with MountPoint, instance THAT'
|
181
|
+
# if path in Storazzo::Media::MountPoint.list_all_mount_points
|
182
|
+
# then return ...
|
183
|
+
if path =~ %r{^gs://}
|
184
|
+
deb 'Smells like GCS'
|
185
|
+
return GcsBucket.new(path)
|
186
|
+
end
|
187
|
+
deb 'Smells like LocalFolder :)'
|
188
|
+
LocalFolder.new(path)
|
189
|
+
end
|
190
|
+
end
|
160
191
|
end
|
161
|
-
deb "Smells like LocalFolder :)"
|
162
|
-
return LocalFolder.new(path)
|
163
192
|
end
|
164
193
|
end
|
165
194
|
end
|
@@ -1,58 +1,89 @@
|
|
1
|
-
|
2
|
-
class Storazzo::RicDisk::GcsBucket
|
3
|
-
extend Storazzo::Common
|
1
|
+
# frozen_string_literal: true
|
4
2
|
|
5
|
-
|
3
|
+
require 'English'
|
6
4
|
|
7
|
-
|
8
|
-
|
5
|
+
module Storazzo
|
6
|
+
module Media
|
7
|
+
# class Storazzo::Media::AbstractRicDisk
|
8
|
+
module Storazzo
|
9
|
+
module Media
|
10
|
+
class GcsBucket < Storazzo::Media::AbstractRicDisk
|
11
|
+
extend Storazzo::Common
|
9
12
|
|
10
|
-
|
11
|
-
@description = "MountPoint in '#{local_mount}' pointing at TODO with mount options = TODO"
|
12
|
-
@project_id = project_id
|
13
|
-
raise "Sorry local mount doesnt exist!" unless File.exist?(@local_mountpoint)
|
13
|
+
attr_accessor :project_id
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
end
|
15
|
+
def initialize(local_mount, project_id = nil)
|
16
|
+
deb '[Storazzo::Media::GcsBucket] initialize'
|
18
17
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
config.load # in case I need to load it for the first time
|
25
|
-
# puts config['Config']['AdditionalMountDirs']
|
26
|
-
# puts "TODO see config: #{config}"
|
27
|
-
# [42, 43]
|
28
|
-
# deb config.get_local_folders
|
29
|
-
# TODO
|
30
|
-
pverbose true,
|
31
|
-
"TODO(ricc): also add gsutil ls. For that please use the new 'list_all_with_type' (Id refactor it but Im afraid of leaving bad code dangling so before a proper refactor lets implement both side by side"
|
32
|
-
config.get_bucket_paths
|
33
|
-
end
|
18
|
+
@local_mountpoint = File.expand_path(local_mount)
|
19
|
+
@description = "MountPoint in '#{local_mount}' pointing at TODO with mount options = TODO"
|
20
|
+
project_id ||= _autodetect_project_id
|
21
|
+
@project_id = project_id
|
22
|
+
raise 'Sorry local mount doesnt exist!' unless File.exist?(@local_mountpoint)
|
34
23
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
if (config.project_id)
|
43
|
-
# so I concatenate Apples with Bananas with names
|
44
|
-
return list_from_config_with_type + list_available_buckets(config.project_id).map { |path|
|
45
|
-
[:gsutil_ls_gcs_bucket, path]
|
46
|
-
}
|
47
|
-
end
|
24
|
+
@wr = writeable? # File.writable?(stats_filename_default_fullpath) # .writeable? stats_file_smart_fullpath
|
25
|
+
begin
|
26
|
+
super(local_mount)
|
27
|
+
rescue StandardError
|
28
|
+
"SUPER_ERROR(#{local_mount}): #{$ERROR_INFO}"
|
29
|
+
end
|
30
|
+
end
|
48
31
|
|
49
|
-
|
50
|
-
|
32
|
+
def _autodetect_project_id
|
33
|
+
'todo-my-project-id-123' # TODO: fix
|
34
|
+
end
|
35
|
+
|
36
|
+
# (config = nil)
|
37
|
+
def self.list_all
|
38
|
+
# get lisrts from Config singletone
|
39
|
+
# puts " self.list_all: loading config "
|
40
|
+
config ||= Storazzo::RicDiskConfig.instance # # ).get_config
|
51
41
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
42
|
+
config.load # in case I need to load it for the first time
|
43
|
+
# puts config['Config']['AdditionalMountDirs']
|
44
|
+
# puts "TODO see config: #{config}"
|
45
|
+
# [42, 43]
|
46
|
+
# deb config.get_local_folders
|
47
|
+
# TODO
|
48
|
+
pverbose true,
|
49
|
+
"TODO(ricc): also add gsutil ls. For that please use the new 'list_all_with_type' (Id refactor it but Im afraid of leaving bad code dangling so before a proper refactor lets implement both side by side"
|
50
|
+
config.get_bucket_paths
|
51
|
+
end
|
52
|
+
|
53
|
+
# (config = nil)
|
54
|
+
def self.list_all_with_type
|
55
|
+
deb 'GCS::list_all_with_type() -- pull config'
|
56
|
+
config ||= Storazzo::RicDiskConfig.instance
|
57
|
+
config.load # in case I need to load it for the first time
|
58
|
+
# puts "GCS::list_all_with_type() -- TODO(ricc): also add gsutil ls"
|
59
|
+
# getFromConfig
|
60
|
+
deb "I'm now returning a 'complex' array to tell the caller what kind of element they're getting, eg: GCS from Config Yaml, vs GCS from gsutil ls "
|
61
|
+
list_from_config_with_type = config.get_bucket_paths.map do |path|
|
62
|
+
[:config_gcs_bucket, path]
|
63
|
+
end
|
64
|
+
ret_list = list_from_config_with_type
|
65
|
+
if config.gcs_enabled? # should be if GCS enabled :) project_id
|
66
|
+
# so I concatenate Apples with Bananas with names
|
67
|
+
# ret_list += list_available_buckets(config.project_id).map { |path|
|
68
|
+
ret_list += list_available_buckets.map do |path|
|
69
|
+
[:gsutil_ls_gcs_bucket, path]
|
70
|
+
end
|
71
|
+
else
|
72
|
+
deb 'list_all_with_type(): empty project id. Skipping'
|
73
|
+
end
|
74
|
+
|
75
|
+
ret_list
|
76
|
+
end
|
77
|
+
|
78
|
+
def self.list_available_buckets(_opts = {})
|
79
|
+
# project_id = opts.fetch :project_id, nil
|
80
|
+
# list_of_buckets = `gsutil ls --project '#{project_id}'`.chomp.split("\n")
|
81
|
+
list_of_buckets = `gsutil ls`.chomp.split("\n")
|
82
|
+
deb "list_of_buckets: #{list_of_buckets}"
|
83
|
+
list_of_buckets
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
56
87
|
end
|
57
88
|
end
|
58
89
|
end
|
@@ -1,48 +1,62 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# require "storazzo/ric_disk/abstract_ric_disk"
|
2
4
|
# require "abstract_ric_disk"
|
3
5
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
6
|
+
require 'English'
|
7
|
+
module Storazzo
|
8
|
+
module Media
|
9
|
+
module Storazzo
|
10
|
+
module Media
|
11
|
+
class LocalFolder < Storazzo::Media::AbstractRicDisk
|
12
|
+
# extend Storazzo::Common
|
13
|
+
include Storazzo::Common
|
14
|
+
|
15
|
+
attr_accessor :local_mountpoint, :wr
|
16
|
+
|
17
|
+
def initialize(local_mount)
|
18
|
+
deb '[Storazzo::Media::LocalFolder] initialize'
|
19
|
+
|
20
|
+
@local_mountpoint = File.expand_path(local_mount)
|
21
|
+
@description = "Local Folder originally in '#{local_mount}'"
|
22
|
+
raise 'Sorry local mount doesnt exist!' unless File.exist?(@local_mountpoint)
|
23
|
+
|
24
|
+
@wr = writeable? # File.writable?(stats_filename_default_fullpath) # .writeable? stats_file_smart_fullpath
|
25
|
+
# super.initialize(local_mount) rescue "SUPER_ERROR: #{$!}"
|
26
|
+
begin
|
27
|
+
super(local_mount)
|
28
|
+
rescue StandardError
|
29
|
+
"SUPER_ERROR(#{local_mount}): #{$ERROR_INFO}"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# WRONG: config = nil
|
34
|
+
def self.list_all
|
35
|
+
# get lists from Config singleton
|
36
|
+
config = Storazzo::RicDiskConfig.instance # # ).get_config
|
37
|
+
config.load
|
38
|
+
config.get_local_folders
|
39
|
+
end
|
40
|
+
|
41
|
+
def parse(opts = {})
|
42
|
+
puts "LF.parse(#{opts}): TODO Sbrodola inside the dir: #{local_mountpoint}"
|
43
|
+
parse_block_storage_folder
|
44
|
+
end
|
45
|
+
|
46
|
+
def path
|
47
|
+
@local_mountpoint
|
48
|
+
end
|
49
|
+
|
50
|
+
def writeable?
|
51
|
+
File.writable?(@local_mountpoint)
|
52
|
+
end
|
53
|
+
|
54
|
+
def default_stats_filename
|
55
|
+
# '42'
|
56
|
+
Storazzo::RicDiskStatsFile.default_name
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
46
60
|
end
|
47
61
|
end
|
48
62
|
end
|
@@ -1,11 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# TODO
|
2
|
-
module Storazzo
|
3
|
-
|
4
|
-
|
4
|
+
module Storazzo
|
5
|
+
module Media
|
6
|
+
module Storazzo
|
7
|
+
module Media
|
8
|
+
class MountPoint < Storazzo::Media::AbstractRicDisk
|
9
|
+
# puts "[REMOVEME] Storazzo::Media::MountPoint being read. REMOVEME when you see this :)"
|
10
|
+
|
11
|
+
def self.list_local_mount_points
|
12
|
+
deb 'Maybe its abuot time you refactor that method here :)'
|
13
|
+
RicDisk.interesting_mount_points
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.list_all
|
17
|
+
RicDisk.interesting_mount_points
|
18
|
+
end
|
5
19
|
|
6
|
-
|
7
|
-
|
8
|
-
|
20
|
+
def self.list_all_with_type
|
21
|
+
list_all.map { |x| [:mount_point_todo_less_generic, x] }
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
9
25
|
end
|
10
26
|
end
|
11
27
|
end
|