egon 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OWRmYjhkMWYyMTg1MzRiMjEwYTM5YjlhNjQ0NjhmOGU5ZmUyODQ3OA==
4
+ ZDcyY2IwNmU3NGJiZTUzZTA0YzEwNmRlN2ZmMjYzZjBjNjNjODFjOQ==
5
5
  data.tar.gz: !binary |-
6
- OTY2ZGFjNTdhNWJhOTA3ZmRiMzg1YWI3NjdmMzFkNzRjM2RjMGM2Yw==
6
+ ZGY3YTNkM2VjYjMwYzhkYTkxZjZmNjg3ZThjYTU3Y2UxNTdmZTAzNA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NzM1NDlmYTE2YWQzMjgzOTQ1MjA2NmRmZWZjYmI3MTI0YzIyMzg2YTkyMGRl
10
- NzhmMjYwOGMzMmU4YmZmYzgxN2I2NTVmZGEyZWIyZjg5NmI4ZjBiZjllYzRj
11
- OTI4MjQwYzhiMGIyMDRiZjQ3MjUwM2RlZjQwNzg3OWI5MzVhODk=
9
+ OGVhOWJkNmQ0M2U4ODk2MGU1M2YwMTc5ZjZhMjU0NjY2MjRiNzI0OGI4YTZm
10
+ NWNkMjE5NTBmNGE1ZjIyOWZhNmY3M2I1NTYwYjBiNTVmMmFmOTU4OTUzMDdh
11
+ ZDRmMGE5NDIyZDdmNWMwNjAzNGFjNzlmMjYyZTYxMzNhZTliYjk=
12
12
  data.tar.gz: !binary |-
13
- MjA0ZmQ2NTEwMmQ0M2MyOTJlYzM5Zjc5YWY5M2EyNmQ5ZDJmMGU4Nzg3ODkx
14
- NTk2MDI0Y2E1NmEyNzRhMDNmNmVlMGYzMzJiMWIzM2E1ZjgxNzQ1NjVhMzk5
15
- MDc1NmU2Y2UyNDZjMGJjMjIxNjMyMTk1NDVhOTIzMjE5MjU5ZjY=
13
+ ZWNkYzU2YWNiMDg4M2MyMzk0ODlmY2U3NWUyNzNhM2I1M2M2NjEzYjczZjZk
14
+ ODBiNDhkNjZlOTEzZWQwMTZmMDNjNjc5NDkyNzY1NWIyNmQ2ZjNmMzNlMDg4
15
+ ZmIxMjQ5NTM2OGE0ZjU2ODAwNzE3YjNkYTAxYzgzZTEwMTM4Y2Y=
@@ -12,3 +12,4 @@ installer.install(Egon::Undercloud::Commands.OSP7_instack_virt)
12
12
  while !installer.completed?
13
13
  sleep 1
14
14
  end
15
+ installer.check_ports
@@ -18,3 +18,4 @@ installer.install(Egon::Undercloud::Commands.OSP7_satellite(SATELLITE_URL, SATEL
18
18
  while !installer.completed?
19
19
  sleep 1
20
20
  end
21
+ installer.check_ports
@@ -16,3 +16,4 @@ installer.install(Egon::Undercloud::Commands.OSP7_vanilla_rhel(RHSM_USER, RHSM_P
16
16
  while !installer.completed?
17
17
  sleep 1
18
18
  end
19
+ installer.check_ports
data/egon.gemspec CHANGED
@@ -26,4 +26,5 @@ Gem::Specification.new do |s|
26
26
  s.add_development_dependency "fog", "~> 1.31.0"
27
27
  s.add_development_dependency "net-ssh", "~> 2.9.2"
28
28
  s.add_development_dependency "rspec", "~> 3.2.0"
29
+ s.add_development_dependency "curb", "~> 0.8.8"
29
30
  end
@@ -27,13 +27,16 @@ module Overcloud
27
27
  def deploy_plan(plan_name)
28
28
  plan = get_plan(plan_name)
29
29
  templates = Hash[plan.provider_resource_templates]
30
+
30
31
  # temporary workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1212740
31
- templates["manifests/overcloud_object.pp"] = templates["puppet/manifests/overcloud_object.pp"]
32
- templates["manifests/ringbuilder.pp"] = templates["puppet/manifests/ringbuilder.pp"]
33
- templates["manifests/overcloud_compute.pp"] = templates["puppet/manifests/overcloud_compute.pp"]
34
- templates["manifests/overcloud_controller.pp"] = templates["puppet/manifests/overcloud_controller.pp"]
35
- templates["manifests/overcloud_volume.pp"] = templates["puppet/manifests/overcloud_volume.pp"]
36
- templates["manifests/overcloud_cephstorage.pp"] = templates["puppet/manifests/overcloud_cephstorage.pp"]
32
+ templates.keys.each do |template_path|
33
+ if template_path.index('puppet/') == 0
34
+ new_template_path = template_path.sub('puppet/','')
35
+ templates[new_template_path] = templates[template_path]
36
+ end
37
+ end
38
+ templates["hieradata/RedHat.yaml"] = templates["puppet/hieradata/RedHat.yaml"]
39
+ templates["yum_update.sh"] = templates["extraconfig/tasks/yum_update.sh"]
37
40
 
38
41
  stack_parameters = {
39
42
  :stack_name => plan.name,
@@ -41,8 +41,6 @@ module Overcloud
41
41
  :extra_specs => {
42
42
  :cpu_arch => cpu_arch,
43
43
  :'capabilities:boot_option' => 'local',
44
- :'baremetal:deploy_kernel_id' => get_baremetal_deploy_kernel_image.id,
45
- :'baremetal:deploy_ramdisk_id' => get_baremetal_deploy_ramdisk_image.id
46
44
  }
47
45
  }
48
46
 
@@ -27,7 +27,7 @@ module Egon
27
27
  end
28
28
 
29
29
  OSP7_COMMON = "
30
- sudo yum install -y http://mirrors.einstein.yu.edu/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
30
+ sudo yum install -y http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
31
31
  sudo yum install -y https://rdoproject.org/repos/openstack-kilo/rdo-release-kilo.rpm
32
32
  sudo curl -o /etc/yum.repos.d/rdo-management-trunk.repo http://trunk-mgt.rdoproject.org/centos-kilo/current-passed-ci/delorean-rdo-management.repo
33
33
  sudo yum install -y python-rdomanager-oscplugin
@@ -38,6 +38,16 @@ module Egon
38
38
  @connection.execute(commands)
39
39
  }
40
40
  end
41
+
42
+ def check_ports
43
+ # closed ports 5385, 36357
44
+ ports = [8774, 9292, 8777, 9696, 8004, 5000, 8585, 5672]
45
+ ports.each do |p|
46
+ if !@connection.port_open?(p)
47
+ set_failure(true)
48
+ end
49
+ end
50
+ end
41
51
  end
42
52
  end
43
53
  end
@@ -1,3 +1,4 @@
1
+ require 'curb'
1
2
  require 'net/ssh'
2
3
  require 'stringio'
3
4
 
@@ -12,6 +13,33 @@ module Egon
12
13
  @user = user
13
14
  @password = password
14
15
  end
16
+
17
+ def port_open?(port, local_ip="127.0.0.1", remote_ip="192.0.2.1", seconds=1)
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|
22
+ puts "Forwarding #{port} #{remote_ip} #{port}"
23
+ session.forward.local( port, remote_ip, port )
24
+ session.loop { true }
25
+ end
26
+ }
27
+
28
+ sleep 1
29
+ begin
30
+ url = "#{local_ip}:#{port}"
31
+ puts "Testing #{url}"
32
+ http = Curl.get(url)
33
+ puts http.body_str
34
+ puts "Port #{port} is open"
35
+ t.kill
36
+ true
37
+ rescue Curl::Err::GotNothingError, Curl::Err::ConnectionFailedError
38
+ puts "Port #{port} is closed"
39
+ t.kill
40
+ false
41
+ end
42
+ end
15
43
 
16
44
  def call_complete
17
45
  @on_complete.call if @on_complete
data/lib/egon/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Egon
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -10,4 +10,8 @@ describe "SSHConnection" do
10
10
  expect(io.string.strip!).to eq("execution expired")
11
11
  end
12
12
 
13
+ it "check port is open" do
14
+ connection = Egon::Undercloud::SSHConnection.new("127.0.0.1", "stack", "test")
15
+ connection.port_open?(1111).should eq false
16
+ end
13
17
  end
@@ -40,6 +40,11 @@ describe "undercloud installer" do
40
40
  it "connection should timeout and installer indicate failure" do
41
41
  run_and_assert_installer(@installer, true)
42
42
  end
43
+
44
+ it "check ports should fail on mock connection" do
45
+ @installer.check_ports
46
+ expect(@installer.failure?).to be true
47
+ end
43
48
 
44
49
  end
45
50
 
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.2.0
4
+ version: 0.3.0
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-06-10 00:00:00.000000000 Z
11
+ date: 2015-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - ~>
81
81
  - !ruby/object:Gem::Version
82
82
  version: 3.2.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: curb
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ~>
88
+ - !ruby/object:Gem::Version
89
+ version: 0.8.8
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ~>
95
+ - !ruby/object:Gem::Version
96
+ version: 0.8.8
83
97
  description: ''
84
98
  email:
85
99
  - foreman-dev+egon@googlegroups.com