linecook-gem 0.4.6 → 0.4.7

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
  SHA1:
3
- metadata.gz: 2081b0606b295283bfcf468a307fc51275e734bf
4
- data.tar.gz: 7bbfa8f7b23f5a91bd3052a854a5d8b3693b74a2
3
+ metadata.gz: 5a93ecc167e2a22ba2fbe82b6158211cf9103f22
4
+ data.tar.gz: 73cbf644f495b907e5adf96b4a30cbc959097942
5
5
  SHA512:
6
- metadata.gz: 944eadf67aacfdaf4a81a2a7fd760e0f00bd3e94266c41961241cc3f6cecaf2c96dee78c5cc8a5ee04ecb43724aad223ae48298cbcd4755656a55aa5fe08d7b5
7
- data.tar.gz: a6bce4f02f3b169cff4193721e1f966320c7617f2563cf5e1d4a0993c35e54612481f7a2e98b59074ca6c4f285b4f2a5a225bbdcf266f690328174046231e17a
6
+ metadata.gz: ba75ddca8e282a97ac9e6159da754772e1e036705b871ed7555628e8e985559b4ee1fc945b2ee5aefec9df480515f8c560f8f47ae63635c3c9304642a03c57a8
7
+ data.tar.gz: 95dc027d3148fb8c4900e87adc6ab09ba88d188afd7baa021678265822e2e8c3521bfd42e4ac2075bc4ac3c739191f22acf320c8e8561bafba324e6c9bfb8421
@@ -124,8 +124,10 @@ module Linecook
124
124
 
125
125
  def write_config
126
126
  path = if @remote
127
- @remote.upload(@config, '/tmp/lxc-config')
128
- '/tmp/lxc-config'
127
+ file = Tempfile.new('lxc-config')
128
+ file.close
129
+ @remote.upload(@config, file.path)
130
+ file.path
129
131
  else
130
132
  file = Tempfile.new('lxc-config')
131
133
  file.write(@config)
@@ -52,5 +52,26 @@ module Linecook
52
52
  fail "Cannot find supported backend for #{Config.platform}"
53
53
  end
54
54
  end
55
+
56
+ def increase_loop_devices
57
+ kparams = {}
58
+ File.read('/proc/cmdline').split(/\s+/).each do |param|
59
+ k,v = param.split('=')
60
+ kparams[k] = v
61
+ end
62
+
63
+ if loops = kparams['max_loop']
64
+ current = ssh.capture('ls -1 /dev | grep loop')
65
+ last_loop = current.lines.length
66
+ to_create = loops.to_i - last_loop
67
+
68
+ to_create.times do |count|
69
+ index = last_loop + count
70
+ ssh.run("mknod -m660 /dev/loop#{index} b 7 #{index}")
71
+ ssh.run("chown root:disk /dev/loop#{index}")
72
+ end
73
+ end
74
+ end
75
+
55
76
  end
56
77
  end
@@ -1,3 +1,3 @@
1
1
  module Linecook
2
- VERSION = '0.4.6'
2
+ VERSION = '0.4.7'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: linecook-gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dale Hamel