[progress] use fqdn instead of IP

Node has othe IP in admin network when it rebooted.
So after provisioning we cannot to parse logs, because IP was
changed.
This commit is contained in:
Evgeniy L 2013-09-12 13:59:47 +04:00
parent 2b964402b8
commit 9a88e94553
3 changed files with 14 additions and 14 deletions

View File

@ -28,17 +28,17 @@ module Astute
def deploy(deployment_info)
raise "Deployment info are not provided!" if deployment_info.blank?
@ctx.deploy_log_parser.deploy_type = deployment_info.first['deployment_mode']
Astute.logger.info "Deployment mode #{@ctx.deploy_log_parser.deploy_type}"
# Generate and upload ssh keys from master node to all cluster nodes.
# Will be used by puppet after to connect nodes between themselves.
generate_and_upload_ssh_keys(%w(nova mysql ceph),
deployment_info.map{ |n| n['uid'] }.uniq,
generate_and_upload_ssh_keys(%w(nova mysql ceph),
deployment_info.map{ |n| n['uid'] }.uniq,
deployment_info.first['deployment_id']
)
# Sort by priority (the lower the number, the higher the priority)
# and send groups to deploy
deployment_info.sort_by { |f| f['priority'] }.group_by{ |f| f['priority'] }.each do |priority, nodes|

View File

@ -49,7 +49,7 @@ module Astute
{'pattern' => 'wait while node rebooting', 'supposed_time' => 20},
].reverse,
'filename' => 'install/anaconda.log',
'path_format' => "<%= @pattern_spec['path_prefix'] %><%= node['ip'] %>/<%= @pattern_spec['filename'] %>",
'path_format' => "<%= @pattern_spec['path_prefix'] %><%= node['fqdn'] %>/<%= @pattern_spec['filename'] %>",
},
'anaconda-log-supposed-time-kvm' => # key for default kvm provision pattern
@ -73,7 +73,7 @@ module Astute
{'pattern' => 'wait while node rebooting', 'supposed_time' => 20},
].reverse,
'filename' => 'install/anaconda.log',
'path_format' => "<%= @pattern_spec['path_prefix'] %><%= node['ip'] %>/<%= @pattern_spec['filename'] %>",
'path_format' => "<%= @pattern_spec['path_prefix'] %><%= node['fqdn'] %>/<%= @pattern_spec['filename'] %>",
},
'puppet-log-components-list-ha-controller' => # key for default HA deploy pattern
@ -81,7 +81,7 @@ module Astute
'endlog_patterns' => [{'pattern' => /Finished catalog run in [0-9]+\.[0-9]* seconds\n/, 'progress' => 1.0}],
'chunk_size' => 40000,
'filename' => 'puppet-agent.log',
'path_format' => "<%= @pattern_spec['path_prefix'] %><%= node['ip'] %>/<%= @pattern_spec['filename'] %>",
'path_format' => "<%= @pattern_spec['path_prefix'] %><%= node['fqdn'] %>/<%= @pattern_spec['filename'] %>",
'components_list' => [
{'name' => 'Galera', 'weight' => 5, 'patterns' => [
{'pattern' => '/Stage[main]/Galera/File[/etc/mysql]/ensure) created', 'progress' => 0.1},
@ -246,7 +246,7 @@ module Astute
'endlog_patterns' => [{'pattern' => /Finished catalog run in [0-9]+\.[0-9]* seconds\n/, 'progress' => 1.0}],
'chunk_size' => 40000,
'filename' => 'puppet-agent.log',
'path_format' => "<%= @pattern_spec['path_prefix'] %><%= node['ip'] %>/<%= @pattern_spec['filename'] %>",
'path_format' => "<%= @pattern_spec['path_prefix'] %><%= node['fqdn'] %>/<%= @pattern_spec['filename'] %>",
'components_list' => [
{'name' => 'Keystone', 'weight' => 10, 'patterns' => [
{'pattern' => '/Stage[main]/Keystone::Python/Package[python-keystone]/ensure) created', 'progress' => 1},
@ -299,7 +299,7 @@ module Astute
'endlog_patterns' => [{'pattern' => /Finished catalog run in [0-9]+\.[0-9]* seconds\n/, 'progress' => 1.0}],
'chunk_size' => 40000,
'filename' => 'puppet-agent.log',
'path_format' => "<%= @pattern_spec['path_prefix'] %><%= node['ip'] %>/<%= @pattern_spec['filename'] %>",
'path_format' => "<%= @pattern_spec['path_prefix'] %><%= node['fqdn'] %>/<%= @pattern_spec['filename'] %>",
'components_list' => [
{'name' => 'Glance', 'weight' => 10, 'patterns' => [
{'pattern' => '/Stage[main]/Glance/Package[glance]/ensure) created', 'progress' => 0.1},
@ -386,7 +386,7 @@ module Astute
'endlog_patterns' => [{'pattern' => /Finished catalog run in [0-9]+\.[0-9]* seconds\n/, 'progress' => 1.0}],
'chunk_size' => 40000,
'filename' => 'puppet-agent.log',
'path_format' => "<%= @pattern_spec['path_prefix'] %><%= node['ip'] %>/<%= @pattern_spec['filename'] %>",
'path_format' => "<%= @pattern_spec['path_prefix'] %><%= node['fqdn'] %>/<%= @pattern_spec['filename'] %>",
'components_list' => [
{'name' => 'Glance', 'weight' => 10, 'patterns' => [
{'pattern' => '/Stage[main]/Glance/Package[glance]/ensure) created', 'progress' => 0.1},
@ -473,7 +473,7 @@ module Astute
'endlog_patterns' => [{'pattern' => /Finished catalog run in [0-9]+\.[0-9]* seconds\n/, 'progress' => 1.0}],
'chunk_size' => 40000,
'filename' => 'puppet-agent.log',
'path_format' => "<%= @pattern_spec['path_prefix'] %><%= node['ip'] %>/<%= @pattern_spec['filename'] %>",
'path_format' => "<%= @pattern_spec['path_prefix'] %><%= node['fqdn'] %>/<%= @pattern_spec['filename'] %>",
'components_list' => [
{'name' => 'Keystone', 'weight' => 10, 'patterns' => [
{'pattern' => '/Stage[main]/Keystone::Python/Package[python-keystone]/ensure) created', 'progress' => 1},

View File

@ -123,7 +123,7 @@ describe LogParser do
Dir.mktmpdir do |dir|
# Create temp log files and structures.
pattern_spec['path_prefix'] = "#{dir}/"
path = "#{pattern_spec['path_prefix']}#{node['ip']}/#{pattern_spec['filename']}"
path = "#{pattern_spec['path_prefix']}#{node['fqdn']}/#{pattern_spec['filename']}"
Dir.mkdir(File.dirname(File.dirname(path)))
Dir.mkdir(File.dirname(path))
node['file'] = File.open(path, 'w')
@ -192,7 +192,7 @@ describe LogParser do
# Create temp log files and structures.
pattern_spec['path_prefix'] = "#{dir}/"
nodes.each do |node|
path = "#{pattern_spec['path_prefix']}#{node['ip']}/#{pattern_spec['filename']}"
path = "#{pattern_spec['path_prefix']}#{node['fqdn']}/#{pattern_spec['filename']}"
Dir.mkdir(File.dirname(path))
node['file'] = File.open(path, 'w')
src_filename = File.join(File.dirname(__FILE__), "..", "example-logs", node['src_filename'])