Skip to content

Conversation

@dirkmueller
Copy link
Contributor

With machines that don't have proper RTC time, we're running into
nasty issues when trying to install on a system that is thinking it
lives in the 70ties.

With machines that don't have proper RTC time, we're running into
nasty issues when trying to install on a system that is thinking it
lives in the 70ties.
end

ntp_servers = search(:node, "roles:ntp-server")
ntp_servers_ips = ntp_servers.map { |n| Chef::Recipe::Barclamp::Inventory.get_network_by_type(n, "admin").address }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. 125/100

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a hint: you don't need the Chef::Recipe:: prefix (but that won't help with the hound warning)

Copy link
Member

@rsalevsky rsalevsky Jul 28, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using a multiline do block should do the trick here and hound should be happy.

ntp_servers_ips = ntp_servers.map do |n|  
    Chef::Recipe::Barclamp::Inventory.get_network_by_type(n, "admin").address
end

<final_reboot config:type="boolean">false</final_reboot>
<halt config:type="boolean">false</halt>
<second_stage config:type="boolean">true</second_stage>
<ntp_sync_time_before_installation><%= @ntp_servers.first %></ntp_sync_time_before_installation>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dirkmueller can you add something like <% unless @ntp_servers.empty? -%> to protect against an empty list of ntp servers?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

9 participants