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 +4 -4
- data/CHANGELOG.md +5 -1
- data/lib/kitchen/driver/lxd/container.rb +25 -7
- data/lib/kitchen/driver/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66958532b083530043a7897ffca23ef14d1322a5
|
4
|
+
data.tar.gz: 42c74aec7000ea99bc219fe850a719f718198005
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20ee77c76546f2cf7782951e42bc0cff1d7f15448403970967a915c13aa229281ed6ec2803d1b74ca3fea2aa926e9275007afebe759f340979b4dd15f9fd3232
|
7
|
+
data.tar.gz: 2e3a72ccb0c16b6ae775b6bf479e4973689d2f65502025b16d40ef1d76005a520acad5167d2453326004f32b1e30af65d230179d5e118a4efcfc520eb6348397
|
data/CHANGELOG.md
CHANGED
@@ -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
|
-
|
60
|
-
|
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[
|
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
|
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[
|
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[
|
102
|
+
@state['devices'] and @state['devices'][network.to_s]
|
85
103
|
end
|
86
104
|
end
|
87
105
|
end
|