cangallo 0.0.3 → 0.0.4

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: c21b6ff98e9fcbbf383de70f0f06f9863e45a84b
4
- data.tar.gz: c383ca0b87759da70f78a982f52b899c3b22e0a8
3
+ metadata.gz: 2f28a4e56d37526b9211c6c841b8557d2dad1577
4
+ data.tar.gz: a1ed9b9e4f6bc3bb415b60dd0581dbc0774e29fe
5
5
  SHA512:
6
- metadata.gz: a58a2b3f477cf582c334b6920a3dc4b22991f901a111fa78818862830f83296e15510b113457fc2502e237fdc30511234fe50478a554ff5f2fe2d6c80c8df87e
7
- data.tar.gz: 0c4ad7d347a66d809cf748d76f0392e1db07f92ed49438e0a23b04fb1ab6ae6d3f645b7136e7cd4830bc3cd97abee5f5185f5474bd8af4395ea0d346236c4da9
6
+ metadata.gz: 19682de08a165a693215ce92a4df771aecd778cfcb84caddbdc35a285ac5c951d9cea29eef68e630e21be13d61c3bb27db33af184494687eb222cb2710b27e08
7
+ data.tar.gz: 845149b932fb7dee71080ea2c3232959ab539b728f869ac2a58209d747d55defbaddde76b0fb2f8e985d1dcfcd57f100b86fe25b5ccc7abdc9af80b70d58fd9f
data/bin/canga CHANGED
@@ -300,6 +300,15 @@ class Canga < Thor
300
300
 
301
301
  repository.write_index
302
302
  end
303
+
304
+ desc "check_system", "check system configuration"
305
+ def check_system
306
+ check = Cangallo::Check.new
307
+
308
+ rc = check.check
309
+
310
+ exit(-1) if rc
311
+ end
303
312
  end
304
313
 
305
314
  Canga.start(ARGV)
data/lib/cangallo.rb CHANGED
@@ -22,6 +22,7 @@ require 'cangallo/cangafile'
22
22
  require 'cangallo/libguestfs'
23
23
  require 'cangallo/keybase'
24
24
  require 'cangallo/version'
25
+ require 'cangallo/check'
25
26
 
26
27
  class Cangallo
27
28
  def initialize
@@ -25,6 +25,26 @@ class Cangallo
25
25
  class Qcow2
26
26
  attr_reader :path
27
27
 
28
+ def self.qemu_img=(path)
29
+ @@qemu_img = path
30
+ end
31
+
32
+ def self.qemu_img
33
+ @@qemu_img ||= "qemu-img"
34
+ end
35
+
36
+ def self.qemu_img_version
37
+ text = execute("--version")
38
+
39
+ m = text.match(/^qemu-img version (\d+\.\d+\.\d+),/)
40
+
41
+ if m
42
+ m[1]
43
+ else
44
+ nil
45
+ end
46
+ end
47
+
28
48
  def initialize(path=nil)
29
49
  @path=path
30
50
  end
@@ -119,7 +139,7 @@ class Cangallo
119
139
  end
120
140
 
121
141
  def self.execute(command, *params)
122
- command = "qemu-img #{command} #{params.join(' ')}"
142
+ command = "#{qemu_img} #{command} #{params.join(' ')}"
123
143
  STDERR.puts command
124
144
 
125
145
  status, stdout, stderr = systemu command
@@ -16,5 +16,5 @@
16
16
  # limitations under the License.
17
17
 
18
18
  class Cangallo
19
- VERSION = '0.0.3'
19
+ VERSION = '0.0.4'
20
20
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cangallo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javier Fontan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-15 00:00:00.000000000 Z
11
+ date: 2016-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
74
  version: '0'
75
75
  requirements: []
76
76
  rubyforge_project:
77
- rubygems_version: 2.5.1
77
+ rubygems_version: 2.5.2
78
78
  signing_key:
79
79
  specification_version: 4
80
80
  summary: Cangallo!!