kitchen-lxd 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1c5051caa8743e2a50fdd4459826900f61e16e03
4
- data.tar.gz: 181a7f2dfc1b10900c35e64c33c068c557bb5fe9
3
+ metadata.gz: 66958532b083530043a7897ffca23ef14d1322a5
4
+ data.tar.gz: 42c74aec7000ea99bc219fe850a719f718198005
5
5
  SHA512:
6
- metadata.gz: 755ce3b4da2ad088ec556d84de20f076c6f7b5d8b7cd9d41d4697fd46de9984c1781a30e83e77234aba73de0b160f7785eba5a30c10e1580f62ce1e8d9409757
7
- data.tar.gz: 0a7ec97eff31370f3297fefdcf240c5bb56703136ff77f012c128cc3ff4cc574b55ac8db17c9fcb3dbfc79f458f6bd11dd8e1f5bd07310907c6b70f4e702784a
6
+ metadata.gz: 20ee77c76546f2cf7782951e42bc0cff1d7f15448403970967a915c13aa229281ed6ec2803d1b74ca3fea2aa926e9275007afebe759f340979b4dd15f9fd3232
7
+ data.tar.gz: 2e3a72ccb0c16b6ae775b6bf479e4973689d2f65502025b16d40ef1d76005a520acad5167d2453326004f32b1e30af65d230179d5e118a4efcfc520eb6348397
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
- ## 0.1.0 / Unreleased
1
+ ## 0.1.1
2
+
3
+ - Support Lxd version 2.8.
4
+
5
+ ## 0.1.0
2
6
 
3
7
  - Initial release
@@ -1,3 +1,21 @@
1
+ # -*- encoding: utf-8 -*-
2
+ #
3
+ # Author:: Juri Timošin (<draco.ater@gmail.com>)
4
+ #
5
+ # Copyright (C) 2017, Juri Timošin
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+
1
19
  require 'kitchen'
2
20
  require 'json'
3
21
 
@@ -56,10 +74,11 @@ module Kitchen
56
74
  info 'Wait for network to become ready.'
57
75
  9.times do
58
76
  update_state
59
- inet = @state[:state][:network][:eth0][:addresses].detect do |i|
60
- i[:family] == 'inet'
77
+ s = @state['state'].nil? ? @state['State'] : @state['state']
78
+ inet = s['network']['eth0']['addresses'].detect do |i|
79
+ i['family'] == 'inet'
61
80
  end
62
- return inet[:address] if inet
81
+ return inet['address'] if inet
63
82
  sleep 1 unless defined?( Minitest )
64
83
  end
65
84
  nil
@@ -68,12 +87,11 @@ module Kitchen
68
87
  private
69
88
 
70
89
  def update_state
71
- @state = JSON.parse( run_command( "lxc list #@name --format json" ),
72
- symbolize_names: true ).first
90
+ @state = JSON.parse( run_command "lxc list #@name --format json" ).first
73
91
  end
74
92
 
75
93
  def running?
76
- @state[:status] == 'Running'
94
+ @state['status'] == 'Running'
77
95
  end
78
96
 
79
97
  def created?
@@ -81,7 +99,7 @@ module Kitchen
81
99
  end
82
100
 
83
101
  def device_attached?( network )
84
- @state[:devices] and @state[:devices][network.to_sym]
102
+ @state['devices'] and @state['devices'][network.to_s]
85
103
  end
86
104
  end
87
105
  end
@@ -19,6 +19,6 @@
19
19
  module Kitchen
20
20
  module Driver
21
21
  # Version string for Lxd Kitchen driver
22
- LXD_VERSION = '0.1.0'
22
+ LXD_VERSION = '0.1.1'
23
23
  end
24
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-lxd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juri Timošin