egon 0.3.1 → 0.3.2

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OTMwNmM5MjRhNThmMTJjMjhhNGYyZTE3OTA2YmZjM2Y5Y2Q0N2ZjNQ==
4
+ YWE5ODAyOTY5NzhiZmU4ODg4ZDM3NDlkZmMwNWYwYzQ5NmFkZjkyNA==
5
5
  data.tar.gz: !binary |-
6
- NGM0NDMzNjgzMGYxNjY2NjA3NmQxZTFlMGNjODFkNDZmY2I1NDQyNQ==
6
+ MTlkZDM5ZTYxNTA5ZWUxNmQ0NDZmZTJlNzdlNTMyMTExMTM0ZWM3OA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NWRjM2IyYmUwOTA2NjE0Y2IyM2Q2ZmEwMTIyZTBjYjU3OTViZmQxMzYxZDdh
10
- Yjg5OGEzZjdmNGE3N2QzNDUxNGVjMTM0ZWUxZWRhMDIyOGZkZDAzMDcxZDRi
11
- OTBmYjk5NDNhMzg3NTZhYjBiMTY5YmMwMGY4YjI5OTQ1OWE5NDA=
9
+ Yjg3MGRlNWI4NmU1MzlmNWI2OTFjNmUzYjI5NWMzMjZkZjM5YzczOTUxZTg4
10
+ MmE3YzNmYWYxODMxNTNmNzU5YThiNWEyN2IzZDY0N2ZiZTg3NGQwZDVlNzVj
11
+ N2Q1ZWNkN2VmNTRmNWJhYzgzOTI0YmFjYWE4ZDIyMGI5MzhmODY=
12
12
  data.tar.gz: !binary |-
13
- ZjhhM2RmMmJjNzk1NTkzOWZiOTY0MjM3MTM3ZDE1YTVjMjdiM2I3MzE1M2Vj
14
- YjkyZjlmOTljYWY5NTcxZjYzMzk4ZjM3NTNhODRkYTczZTNhYzVjNjM4ZWI5
15
- ZGEzOWVlNDJkNjExY2E2OTkxYzc4OTBlMmM4ZjNkZTAzNTA4YTA=
13
+ NzgzZTg0ZDdiYmYwNzRiNGQ4OWRhMDc0OTFiMjUwYThiYzdmZGJlMjIyMWFm
14
+ YTk5MTZlNmFjYmEyYjlkZjgyYjg2MjQ2YjViMTNlZjQxYjhkZjBmMTY4YmVi
15
+ NjA5NTExMGU0OGI3NzhiMmYzMjljNDJhY2ZjYTYxZDc2MWQyNDM=
@@ -54,9 +54,13 @@ module Overcloud
54
54
  }
55
55
  service('Orchestration').stacks.new.save(stack_parameters)
56
56
  end
57
+
58
+ def list_stacks
59
+ service('Orchestration').stacks.all
60
+ end
57
61
 
58
- def get_stack(stack_name)
59
- service('Orchestration').stacks.get(stack_name)
62
+ def get_stack_by_name(stack_name)
63
+ list_stacks.find{|s| s.stack_name == stack_name}
60
64
  end
61
65
 
62
66
  end
@@ -1,4 +1,4 @@
1
- require 'curb'
1
+ require 'net/http'
2
2
  require 'net/ssh'
3
3
  require 'stringio'
4
4
 
@@ -16,25 +16,31 @@ module Egon
16
16
 
17
17
  def port_open?(port, local_ip="127.0.0.1", remote_ip="192.0.2.1", seconds=1)
18
18
  t = Thread.new {
19
- Net::SSH.start(@host, @user, :password => @password, :timeout => 2,
20
- :auth_methods => ["password"],
21
- :number_of_password_prompts => 0) do |session|
19
+ begin
20
+ Net::SSH.start(@host, @user, :password => @password, :timeout => seconds,
21
+ :auth_methods => ["password"],
22
+ :number_of_password_prompts => 0) do |session|
22
23
  puts "Forwarding #{port} #{remote_ip} #{port}"
23
24
  session.forward.local( port, remote_ip, port )
24
25
  session.loop { true }
25
26
  end
27
+ rescue => e
28
+ puts e.message
29
+ end
26
30
  }
27
31
 
28
32
  sleep 1
29
33
  begin
30
- url = "#{local_ip}:#{port}"
34
+ url = "http://#{local_ip}:#{port}"
31
35
  puts "Testing #{url}"
32
- http = Curl.get(url)
33
- puts http.body_str
36
+ res = Net::HTTP.get_response(URI(url))
37
+ puts res.body
34
38
  puts "Port #{port} is open"
35
39
  t.kill
36
40
  true
37
- rescue Curl::Err::GotNothingError, Curl::Err::ConnectionFailedError
41
+ rescue => e
42
+ puts e.message
43
+ puts e.backtrace
38
44
  puts "Port #{port} is closed"
39
45
  t.kill
40
46
  false
data/lib/egon/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Egon
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: egon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Egon and Fusor team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-10 00:00:00.000000000 Z
11
+ date: 2015-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler