easy_manager 0.9.2 → 0.9.3

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
  SHA256:
3
- metadata.gz: 11feb80943534098ca933a620ea7face972816314e4292336b34ea432ff0f5b4
4
- data.tar.gz: de1c828f3d43fc9581c9e99045a11741bb77567c1f341b89ac268cfda7544888
3
+ metadata.gz: bfb1e50bc8e3aa5d0b6387b1464774ceab853e72e476bbfdde0235da92cb5fa5
4
+ data.tar.gz: 559ec2811c9aed00b58e32e020635e8d0eb65e9843fd44168c5ecb16e66cc7b2
5
5
  SHA512:
6
- metadata.gz: 00cd84e57894fee52e4ea070f27db99f3ca3c9f1c8c9df46adf50e5e4c1ccd0f8384b87686d3968cb76d739483559b2528c937cdd542c8e5e1cd6d5c7d7cf909
7
- data.tar.gz: b06fc5f300eccce23a5a3fbbddf25dfc0bfc23b3c76307cd04d6ea4d07afd8c842097d2fb79e3920e4b123aae7b4ad1ba15dcd189f215b6742d5a1b8ac66c934
6
+ metadata.gz: ddded25e7989bf1e70dd6d13571f3e7d2ff7cbb998683d62c11c90102b8d781e3803b977f8c6b7b86342923602d10514bc8896b227506fa36820e59e054155c0
7
+ data.tar.gz: bd1a66cfc21f9f3e6b541345114204fa00a335d46942d7b715df2c20101ed0e2654b0f94ba77739ac6e59a776611a13538112a2925d28fc6b6f997e0a3c1aee7
@@ -35,9 +35,16 @@ class EasyManager
35
35
  end
36
36
 
37
37
  def delete_by_id(id)
38
+ response = nil
38
39
  servers = list
39
40
 
40
- servers.each { |server| delete(server) if server['id'] == id }
41
+ servers.each do |server|
42
+ next unless server['id'] == id
43
+
44
+ response = delete(server)
45
+ end
46
+
47
+ response
41
48
  end
42
49
 
43
50
  def status(srv)
@@ -48,7 +55,7 @@ class EasyManager
48
55
  Servers.ready?(self, srv, ssh, srv_ready_cmds)
49
56
  end
50
57
 
51
- def wait_until_ready!(srv, ssh, timeout = 300)
58
+ def wait_until_ready!(srv, ssh, timeout = 360)
52
59
  ready = false
53
60
  start = Time.now
54
61
  loop do
@@ -67,7 +74,7 @@ class EasyManager
67
74
  check_cloud_init_cmd = "test -f '/var/log/cloud-init.log' && echo true"
68
75
  cloud_init_ready_cmd = 'tail -1 /var/log/cloud-init-output.log'
69
76
 
70
- [check_cloud_init_cmd, cloud_init_ready_cmd, 'hostname']
77
+ [check_cloud_init_cmd, cloud_init_ready_cmd]
71
78
  end
72
79
  end
73
80
  end
@@ -29,11 +29,11 @@ class EasyManager
29
29
  return unless srv_up?(scw, srv)
30
30
 
31
31
  cmd_values = SSH.cmd_exec(ssh, srv, cmds)
32
- if cmd_values[cmds[0]].empty?
33
- cmd_values['hostname'] == srv['hostname']
34
- else
35
- cmd_values[cmds[1]].include?('The system is finally up')
36
- end
32
+ return unless cmd_values
33
+ return if cmd_values[cmds[0]].empty?
34
+
35
+ cmd_values[cmds[1]].include?('The system is finally up') ||
36
+ cmd_values[cmds[1]].match?(/Cloud-init v.*finished\sat.*Up.*seconds/)
37
37
  end
38
38
 
39
39
  def self.status(scw, srv_id)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua MARTINELLE
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-31 00:00:00.000000000 Z
11
+ date: 2022-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bcrypt_pbkdf