wf_node_api 0.6.0 → 0.7.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.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +22 -18
  3. data/Gemfile.lock +3 -3
  4. data/LICENSE +19 -340
  5. data/Vagrantfile +28 -23
  6. data/_docs/api/Api.html +22 -18
  7. data/_docs/api/Api/NodeApi.html +1 -1
  8. data/_docs/api/ConfigCheck.html +34 -30
  9. data/_docs/api/ContainerManager.html +176 -77
  10. data/_docs/api/ContainerManagerAdapter.html +22 -18
  11. data/_docs/api/ContainerManagerAdapter/Lxc.html +169 -58
  12. data/_docs/api/ContainerManagerAdapter/Vserver.html +169 -58
  13. data/_docs/api/NotFoundError.html +22 -18
  14. data/_docs/api/OS.html +26 -22
  15. data/_docs/api/ResourceManager.html +11 -11
  16. data/_docs/api/ResourceManagerAdapter.html +22 -18
  17. data/_docs/api/ResourceManagerAdapter/Linux.html +13 -13
  18. data/_docs/api/WfNodeApi.html +23 -19
  19. data/_docs/api/_index.html +1 -1
  20. data/_docs/api/file.README.html +96 -66
  21. data/_docs/api/index.html +96 -66
  22. data/_docs/api/method_list.html +60 -42
  23. data/_docs/api/top-level-namespace.html +7 -7
  24. data/_docs/rest/api_data.js +934 -1
  25. data/_docs/rest/api_data.json +934 -1
  26. data/_docs/rest/api_project.js +31 -1
  27. data/_docs/rest/api_project.json +31 -1
  28. data/bin/wf_node_api +25 -21
  29. data/lib/wf_node_api.rb +25 -21
  30. data/lib/wf_node_api/api/node_api.rb +36 -27
  31. data/lib/wf_node_api/config/config_template.erb +36 -4
  32. data/lib/wf_node_api/config_check.rb +25 -21
  33. data/lib/wf_node_api/container_manager.rb +34 -22
  34. data/lib/wf_node_api/container_manager_adapter/lxc.rb +43 -25
  35. data/lib/wf_node_api/container_manager_adapter/vserver.rb +45 -27
  36. data/lib/wf_node_api/error/not_found.rb +22 -18
  37. data/lib/wf_node_api/os.rb +22 -18
  38. data/lib/wf_node_api/resource_manager.rb +24 -20
  39. data/lib/wf_node_api/resource_manager_adapter/linux.rb +25 -21
  40. data/lib/wf_node_api/translations.rb +22 -18
  41. data/lib/wf_node_api/version.rb +22 -18
  42. data/wf-node-api.gemspec +26 -22
  43. metadata +4 -3
@@ -1,26 +1,30 @@
1
1
  =begin
2
- __ ___ _ _ _____ ____ __ __
3
- \ \ / / |__ (_) |_ ___| ___| _ ___ ___ / ___| \/ |
4
- \ \ /\ / /| '_ \| | __/ _ \ |_ | | | / __|/ _ \ | | |\/| |
5
- \ V V / | | | | | || __/ _|| |_| \__ \ __/ |___| | | |
6
- \_/\_/ |_| |_|_|\__\___|_| \__,_|___/\___|\____|_| |_|
2
+ __ ___ _ _ _____ ____ __ __
3
+ \ \ / / |__ (_) |_ ___| ___| _ ___ ___ / ___| \/ |
4
+ \ \ /\ / /| '_ \| | __/ _ \ |_ | | | / __|/ _ \ | | |\/| |
5
+ \ V V / | | | | | || __/ _|| |_| \__ \ __/ |___| | | |
6
+ \_/\_/ |_| |_|_|\__\___|_| \__,_|___/\___|\____|_| |_|
7
7
  Container Manager
8
8
 
9
- Copyright (C) 2015 David Prandzioch <kontakt@davidprandzioch.de>
10
-
11
- This program is free software; you can redistribute it and/or
12
- modify it under the terms of the GNU General Public License
13
- as published by the Free Software Foundation; either version 2
14
- of the License, or (at your option) any later version.
15
-
16
- This program is distributed in the hope that it will be useful,
17
- but WITHOUT ANY WARRANTY; without even the implied warranty of
18
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
- GNU General Public License for more details.
20
-
21
- You should have received a copy of the GNU General Public License
22
- along with this program; if not, write to the Free Software
23
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
9
+ Copyright (c) 2015 David Prandzioch <kontakt@davidprandzioch.de>
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
12
+ this software and associated documentation files (the "Software"), to deal in
13
+ the Software without restriction, including without limitation the rights to
14
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
15
+ of the Software, and to permit persons to whom the Software is furnished to do
16
+ so, subject to the following conditions:
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
24
28
  =end
25
29
 
26
30
  # Manager for containers, meta class
@@ -178,6 +182,13 @@ class ContainerManager
178
182
  @adapter.container(name)
179
183
  end
180
184
 
185
+ # Returns a list of supported templates
186
+ #
187
+ # @return [Hash] List of supported templates
188
+ def supported_templates
189
+ @adapter.supported_templates
190
+ end
191
+
181
192
  # Returns the amount of free cpu cores
182
193
  #
183
194
  # @param resman [ResourceManager] A ResourceManager instance
@@ -258,13 +269,14 @@ class ContainerManager
258
269
  # @param disk_size_gb [Integer] The disk size in GB
259
270
  # @param memory_limit_mb [Integer] The memory limit in MB
260
271
  # @param cpu_core_count [Integer] Amount of Vcores to assign
272
+ # @param template [String] Name of the template to use
261
273
  #
262
274
  # @raise [RuntimeError]
263
275
  # @raise [NotFoundError]
264
276
  # @raise [ArgumentError]
265
277
  #
266
278
  # @return [String] CLI output
267
- def create_container(name, ip_address, disk_size_gb, memory_limit_mb, cpu_core_count)
279
+ def create_container(name, ip_address, disk_size_gb, memory_limit_mb, cpu_core_count, template)
268
280
  disk_size_gb = disk_size_gb.to_i
269
281
  memory_limit_mb = memory_limit_mb.to_i
270
282
  cpu_core_count = cpu_core_count.to_i
@@ -281,6 +293,6 @@ class ContainerManager
281
293
  raise ::NotFoundError
282
294
  end
283
295
 
284
- @adapter.create_container(name, ip_address, disk_size_gb, memory_limit_mb, cpu_core_count)
296
+ @adapter.create_container(name, ip_address, disk_size_gb, memory_limit_mb, cpu_core_count, template)
285
297
  end
286
298
  end
@@ -1,26 +1,30 @@
1
1
  =begin
2
- __ ___ _ _ _____ ____ __ __
3
- \ \ / / |__ (_) |_ ___| ___| _ ___ ___ / ___| \/ |
4
- \ \ /\ / /| '_ \| | __/ _ \ |_ | | | / __|/ _ \ | | |\/| |
5
- \ V V / | | | | | || __/ _|| |_| \__ \ __/ |___| | | |
6
- \_/\_/ |_| |_|_|\__\___|_| \__,_|___/\___|\____|_| |_|
2
+ __ ___ _ _ _____ ____ __ __
3
+ \ \ / / |__ (_) |_ ___| ___| _ ___ ___ / ___| \/ |
4
+ \ \ /\ / /| '_ \| | __/ _ \ |_ | | | / __|/ _ \ | | |\/| |
5
+ \ V V / | | | | | || __/ _|| |_| \__ \ __/ |___| | | |
6
+ \_/\_/ |_| |_|_|\__\___|_| \__,_|___/\___|\____|_| |_|
7
7
  Container Manager
8
8
 
9
- Copyright (C) 2015 David Prandzioch <kontakt@davidprandzioch.de>
10
-
11
- This program is free software; you can redistribute it and/or
12
- modify it under the terms of the GNU General Public License
13
- as published by the Free Software Foundation; either version 2
14
- of the License, or (at your option) any later version.
15
-
16
- This program is distributed in the hope that it will be useful,
17
- but WITHOUT ANY WARRANTY; without even the implied warranty of
18
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
- GNU General Public License for more details.
20
-
21
- You should have received a copy of the GNU General Public License
22
- along with this program; if not, write to the Free Software
23
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
9
+ Copyright (c) 2015 David Prandzioch <kontakt@davidprandzioch.de>
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
12
+ this software and associated documentation files (the "Software"), to deal in
13
+ the Software without restriction, including without limitation the rights to
14
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
15
+ of the Software, and to permit persons to whom the Software is furnished to do
16
+ so, subject to the following conditions:
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
24
28
  =end
25
29
 
26
30
  module ContainerManagerAdapter
@@ -144,11 +148,12 @@ module ContainerManagerAdapter
144
148
  # @param disk_size_gb [Integer] The disk size in GB
145
149
  # @param memory_limit_mb [Integer] The memory limit in MB
146
150
  # @param cpu_core_count [Integer] Amount of Vcores to assign. 0 if no limit should be set
151
+ # @param template [String] Name of the template to use
147
152
  #
148
153
  # @raise [RuntimeError]
149
154
  #
150
155
  # @return [String] CLI output
151
- def create_container(name, ip_address, disk_size_gb, memory_limit_mb, cpu_core_count)
156
+ def create_container(name, ip_address, disk_size_gb, memory_limit_mb, cpu_core_count, template)
152
157
  output = ''
153
158
 
154
159
  begin
@@ -156,7 +161,11 @@ module ContainerManagerAdapter
156
161
  cpuset = self.generate_cpu_set(cpu_core_count, ResourceManager.new('linux'))
157
162
  end
158
163
 
159
- create_result = Open3.capture3($lxc_cmd_create.gsub('[name]', name))
164
+ if false == $lxc_cmd_create.has_key?(template)
165
+ raise ArgumentError, "template does not exist"
166
+ end
167
+
168
+ create_result = Open3.capture3($lxc_cmd_create[template].gsub('[name]', name))
160
169
 
161
170
  output += create_result[0]
162
171
  output += create_result[1]
@@ -168,11 +177,13 @@ module ContainerManagerAdapter
168
177
  f << "lxc.start.auto=1\n"
169
178
  f << "lxc.start.delay=5\n"
170
179
 
171
- if cpu_core_count != 0
180
+ if cpu_core_count.to_i != 0
172
181
  f << "lxc.cgroup.cpuset.cpus=#{cpuset}\n"
173
182
  end
174
183
 
175
- f << "lxc.cgroup.memory.limit_in_bytes=#{memory_limit_mb.to_s}M\n"
184
+ if memory_limit_mb.to_i != 0
185
+ f << "lxc.cgroup.memory.limit_in_bytes=#{memory_limit_mb.to_s}M\n"
186
+ end
176
187
  end
177
188
 
178
189
  $logger.info("creation of container " + name + " successful")
@@ -206,6 +217,13 @@ module ContainerManagerAdapter
206
217
  self.free_cpu_cores(resman).count
207
218
  end
208
219
 
220
+ # Returns a list of supported templates
221
+ #
222
+ # @return [Hash] List of supported templates
223
+ def supported_templates
224
+ $lxc_cmd_create.keys
225
+ end
226
+
209
227
  protected
210
228
  # Reads the config file of a LXC container
211
229
  #
@@ -428,4 +446,4 @@ module ContainerManagerAdapter
428
446
  cores_to_use.join(',')
429
447
  end
430
448
  end
431
- end
449
+ end
@@ -1,26 +1,30 @@
1
1
  =begin
2
- __ ___ _ _ _____ ____ __ __
3
- \ \ / / |__ (_) |_ ___| ___| _ ___ ___ / ___| \/ |
4
- \ \ /\ / /| '_ \| | __/ _ \ |_ | | | / __|/ _ \ | | |\/| |
5
- \ V V / | | | | | || __/ _|| |_| \__ \ __/ |___| | | |
6
- \_/\_/ |_| |_|_|\__\___|_| \__,_|___/\___|\____|_| |_|
2
+ __ ___ _ _ _____ ____ __ __
3
+ \ \ / / |__ (_) |_ ___| ___| _ ___ ___ / ___| \/ |
4
+ \ \ /\ / /| '_ \| | __/ _ \ |_ | | | / __|/ _ \ | | |\/| |
5
+ \ V V / | | | | | || __/ _|| |_| \__ \ __/ |___| | | |
6
+ \_/\_/ |_| |_|_|\__\___|_| \__,_|___/\___|\____|_| |_|
7
7
  Container Manager
8
8
 
9
- Copyright (C) 2015 David Prandzioch <kontakt@davidprandzioch.de>
10
-
11
- This program is free software; you can redistribute it and/or
12
- modify it under the terms of the GNU General Public License
13
- as published by the Free Software Foundation; either version 2
14
- of the License, or (at your option) any later version.
15
-
16
- This program is distributed in the hope that it will be useful,
17
- but WITHOUT ANY WARRANTY; without even the implied warranty of
18
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
- GNU General Public License for more details.
20
-
21
- You should have received a copy of the GNU General Public License
22
- along with this program; if not, write to the Free Software
23
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
9
+ Copyright (c) 2015 David Prandzioch <kontakt@davidprandzioch.de>
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
12
+ this software and associated documentation files (the "Software"), to deal in
13
+ the Software without restriction, including without limitation the rights to
14
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
15
+ of the Software, and to permit persons to whom the Software is furnished to do
16
+ so, subject to the following conditions:
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
24
28
  =end
25
29
 
26
30
  module ContainerManagerAdapter
@@ -142,11 +146,12 @@ module ContainerManagerAdapter
142
146
  # @param disk_size_gb [Integer] The disk size in GB
143
147
  # @param memory_limit_mb [Integer] The memory limit in MB
144
148
  # @param cpu_core_count [Integer] Amount of Vcores to assign. 0 for no limit
149
+ # @param template [String] Name of the template to use
145
150
  #
146
151
  # @raise [RuntimeError]
147
152
  #
148
153
  # @return [String] CLI output
149
- def create_container(name, ip_address, disk_size_gb, memory_limit_mb, cpu_core_count)
154
+ def create_container(name, ip_address, disk_size_gb, memory_limit_mb, cpu_core_count, template)
150
155
  output = ''
151
156
 
152
157
  begin
@@ -154,8 +159,12 @@ module ContainerManagerAdapter
154
159
  cpuset = generate_cpu_set(cpu_core_count, ResourceManager.new('linux'))
155
160
  end
156
161
 
162
+ if false == $vserver_cmd_create.has_key?(template)
163
+ raise ArgumentError, "template does not exist"
164
+ end
165
+
157
166
  new_context = highest_context() + 1
158
- cmd = $vserver_cmd_create.gsub('[name]', name).gsub('[ip_address]', ip_address).gsub('[context]', new_context.to_s)
167
+ cmd = $vserver_cmd_create[template].gsub('[name]', name).gsub('[ip_address]', ip_address).gsub('[context]', new_context.to_s)
159
168
 
160
169
  create_result = Open3.capture3(cmd)
161
170
 
@@ -167,11 +176,13 @@ module ContainerManagerAdapter
167
176
  end
168
177
 
169
178
  # memory limit
170
- memory_limit_bytes = memory_limit_mb.to_i * 1024 * 1024
171
- page_size = `#{$page_size_cmd}`.to_i
172
- memory_limit_pages = memory_limit_bytes / page_size
179
+ if memory_limit_mb.to_i != 0
180
+ memory_limit_bytes = memory_limit_mb.to_i * 1024 * 1024
181
+ page_size = `#{$page_size_cmd}`.to_i
182
+ memory_limit_pages = memory_limit_bytes / page_size
173
183
 
174
- write_config_file(name, '/rlimits/rss.hard', memory_limit_pages.to_s)
184
+ write_config_file(name, '/rlimits/rss.hard', memory_limit_pages.to_s)
185
+ end
175
186
 
176
187
  if cpu_core_count != 0
177
188
  # cpu core limit
@@ -209,6 +220,13 @@ module ContainerManagerAdapter
209
220
  self.free_cpu_cores(resman).count
210
221
  end
211
222
 
223
+ # Returns a list of supported templates
224
+ #
225
+ # @return [Hash] List of supported templates
226
+ def supported_templates
227
+ $vserver_cmd_create.keys
228
+ end
229
+
212
230
  protected
213
231
  # Writes the config file of a vserver
214
232
  #
@@ -445,4 +463,4 @@ module ContainerManagerAdapter
445
463
  `#{$vserver_cmd_ls}`.lines.map(&:strip).uniq
446
464
  end
447
465
  end
448
- end
466
+ end
@@ -1,27 +1,31 @@
1
1
  =begin
2
- __ ___ _ _ _____ ____ __ __
3
- \ \ / / |__ (_) |_ ___| ___| _ ___ ___ / ___| \/ |
4
- \ \ /\ / /| '_ \| | __/ _ \ |_ | | | / __|/ _ \ | | |\/| |
5
- \ V V / | | | | | || __/ _|| |_| \__ \ __/ |___| | | |
6
- \_/\_/ |_| |_|_|\__\___|_| \__,_|___/\___|\____|_| |_|
2
+ __ ___ _ _ _____ ____ __ __
3
+ \ \ / / |__ (_) |_ ___| ___| _ ___ ___ / ___| \/ |
4
+ \ \ /\ / /| '_ \| | __/ _ \ |_ | | | / __|/ _ \ | | |\/| |
5
+ \ V V / | | | | | || __/ _|| |_| \__ \ __/ |___| | | |
6
+ \_/\_/ |_| |_|_|\__\___|_| \__,_|___/\___|\____|_| |_|
7
7
  Container Manager
8
8
 
9
- Copyright (C) 2015 David Prandzioch <kontakt@davidprandzioch.de>
9
+ Copyright (c) 2015 David Prandzioch <kontakt@davidprandzioch.de>
10
10
 
11
- This program is free software; you can redistribute it and/or
12
- modify it under the terms of the GNU General Public License
13
- as published by the Free Software Foundation; either version 2
14
- of the License, or (at your option) any later version.
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
12
+ this software and associated documentation files (the "Software"), to deal in
13
+ the Software without restriction, including without limitation the rights to
14
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
15
+ of the Software, and to permit persons to whom the Software is furnished to do
16
+ so, subject to the following conditions:
15
17
 
16
- This program is distributed in the hope that it will be useful,
17
- but WITHOUT ANY WARRANTY; without even the implied warranty of
18
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
- GNU General Public License for more details.
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
20
 
21
- You should have received a copy of the GNU General Public License
22
- along with this program; if not, write to the Free Software
23
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
24
28
  =end
25
29
 
26
30
  class NotFoundError < StandardError
27
- end
31
+ end
@@ -1,26 +1,30 @@
1
1
  =begin
2
- __ ___ _ _ _____ ____ __ __
3
- \ \ / / |__ (_) |_ ___| ___| _ ___ ___ / ___| \/ |
4
- \ \ /\ / /| '_ \| | __/ _ \ |_ | | | / __|/ _ \ | | |\/| |
5
- \ V V / | | | | | || __/ _|| |_| \__ \ __/ |___| | | |
6
- \_/\_/ |_| |_|_|\__\___|_| \__,_|___/\___|\____|_| |_|
2
+ __ ___ _ _ _____ ____ __ __
3
+ \ \ / / |__ (_) |_ ___| ___| _ ___ ___ / ___| \/ |
4
+ \ \ /\ / /| '_ \| | __/ _ \ |_ | | | / __|/ _ \ | | |\/| |
5
+ \ V V / | | | | | || __/ _|| |_| \__ \ __/ |___| | | |
6
+ \_/\_/ |_| |_|_|\__\___|_| \__,_|___/\___|\____|_| |_|
7
7
  Container Manager
8
8
 
9
- Copyright (C) 2015 David Prandzioch <kontakt@davidprandzioch.de>
9
+ Copyright (c) 2015 David Prandzioch <kontakt@davidprandzioch.de>
10
10
 
11
- This program is free software; you can redistribute it and/or
12
- modify it under the terms of the GNU General Public License
13
- as published by the Free Software Foundation; either version 2
14
- of the License, or (at your option) any later version.
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
12
+ this software and associated documentation files (the "Software"), to deal in
13
+ the Software without restriction, including without limitation the rights to
14
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
15
+ of the Software, and to permit persons to whom the Software is furnished to do
16
+ so, subject to the following conditions:
15
17
 
16
- This program is distributed in the hope that it will be useful,
17
- but WITHOUT ANY WARRANTY; without even the implied warranty of
18
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
- GNU General Public License for more details.
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
20
 
21
- You should have received a copy of the GNU General Public License
22
- along with this program; if not, write to the Free Software
23
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
24
28
  =end
25
29
 
26
30
  module OS
@@ -29,4 +33,4 @@ module OS
29
33
  def self.linux?
30
34
  RUBY_PLATFORM.include?('linux')
31
35
  end
32
- end
36
+ end
@@ -1,26 +1,30 @@
1
1
  =begin
2
- __ ___ _ _ _____ ____ __ __
3
- \ \ / / |__ (_) |_ ___| ___| _ ___ ___ / ___| \/ |
4
- \ \ /\ / /| '_ \| | __/ _ \ |_ | | | / __|/ _ \ | | |\/| |
5
- \ V V / | | | | | || __/ _|| |_| \__ \ __/ |___| | | |
6
- \_/\_/ |_| |_|_|\__\___|_| \__,_|___/\___|\____|_| |_|
2
+ __ ___ _ _ _____ ____ __ __
3
+ \ \ / / |__ (_) |_ ___| ___| _ ___ ___ / ___| \/ |
4
+ \ \ /\ / /| '_ \| | __/ _ \ |_ | | | / __|/ _ \ | | |\/| |
5
+ \ V V / | | | | | || __/ _|| |_| \__ \ __/ |___| | | |
6
+ \_/\_/ |_| |_|_|\__\___|_| \__,_|___/\___|\____|_| |_|
7
7
  Container Manager
8
8
 
9
- Copyright (C) 2015 David Prandzioch <kontakt@davidprandzioch.de>
10
-
11
- This program is free software; you can redistribute it and/or
12
- modify it under the terms of the GNU General Public License
13
- as published by the Free Software Foundation; either version 2
14
- of the License, or (at your option) any later version.
15
-
16
- This program is distributed in the hope that it will be useful,
17
- but WITHOUT ANY WARRANTY; without even the implied warranty of
18
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
- GNU General Public License for more details.
20
-
21
- You should have received a copy of the GNU General Public License
22
- along with this program; if not, write to the Free Software
23
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
9
+ Copyright (c) 2015 David Prandzioch <kontakt@davidprandzioch.de>
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
12
+ this software and associated documentation files (the "Software"), to deal in
13
+ the Software without restriction, including without limitation the rights to
14
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
15
+ of the Software, and to permit persons to whom the Software is furnished to do
16
+ so, subject to the following conditions:
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
24
28
  =end
25
29
 
26
30
  # Top level class for resource management