Skip to content

Commit 17e7255

Browse files
committed
Fix rubocop offense
1 parent ad27d9f commit 17e7255

File tree

4 files changed

+30
-27
lines changed

4 files changed

+30
-27
lines changed

testsuite/features/step_definitions/api_common.rb

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,18 @@
1010

1111
When(/^I delete all the imported terminals$/) do
1212
terminals = read_terminals_from_yaml
13-
short_names_to_process = terminals.reject do |terminal_name|
14-
terminal_name.include?('minion') || terminal_name.include?('client')
15-
end
13+
short_names_to_process =
14+
terminals.reject do |terminal_name|
15+
terminal_name.include?('minion') || terminal_name.include?('client')
16+
end
1617
log "Terminals identified for deletion (short names): #{short_names_to_process.join(', ')}"
1718
current_systems = $api_test.system.list_systems
1819
full_names_to_delete = []
1920
short_names_to_process.each do |short_name|
20-
match = current_systems.find do |s|
21-
s['name'].split('.').include?(short_name)
22-
end
21+
match =
22+
current_systems.find do |s|
23+
s['name'].split('.').include?(short_name)
24+
end
2325
if match
2426
full_names_to_delete << match['name']
2527
else
@@ -29,7 +31,7 @@
2931
if full_names_to_delete.any?
3032
$api_test.system.delete_systems_by_name(full_names_to_delete)
3133
else
32-
log "No matching systems found to delete."
34+
log 'No matching systems found to delete.'
3335
end
3436
end
3537

testsuite/features/step_definitions/retail_steps.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
# Server Applications, proxy product and modules, proxy devel
1818
if os_family.match?(/^sles/) && os_version.match?(/^15/)
1919
repos += 'proxy_module_pool_repo proxy_module_update_repo ' \
20-
'proxy_product_pool_repo proxy_product_update_repo ' \
21-
'module_server_applications_pool_repo module_server_applications_update_repo '
20+
'proxy_product_pool_repo proxy_product_update_repo ' \
21+
'module_server_applications_pool_repo module_server_applications_update_repo '
2222
repos += 'proxy_devel_releasenotes_repo proxy_devel_repo ' unless $build_validation || product_version_full.include?('-released')
2323
elsif os_family.match?(/^opensuse/)
2424
repos += 'proxy_pool_repo ' unless $is_containerized_server
@@ -33,9 +33,9 @@
3333
when 'Uyuni'
3434
step 'I enable repositories before installing branch server'
3535
cmd = 'zypper --non-interactive --ignore-unknown remove atftp && ' \
36-
'zypper --non-interactive install tftp && ' \
37-
'systemctl enable tftp.service && ' \
38-
'systemctl start tftp.service'
36+
'zypper --non-interactive install tftp && ' \
37+
'systemctl enable tftp.service && ' \
38+
'systemctl start tftp.service'
3939
get_target('proxy').run(cmd)
4040
step 'I disable repositories after installing branch server'
4141
else
@@ -117,17 +117,17 @@
117117
# otherwise the name server we get from DHCP is lost at the end of the list
118118
# (the name servers list in resolv.conf is limited to 3 entries)
119119
cmd = 'nmcli connection modify "Wired connection 1" ipv4.dns-priority 20 && ' \
120-
"nmcli device modify #{node.public_interface} ipv4.dns-priority 20 && " \
121-
'nmcli connection modify "Wired connection 2" ipv4.dns-priority 10 && ' \
122-
"nmcli device modify #{node.private_interface} ipv4.dns-priority 10"
120+
"nmcli device modify #{node.public_interface} ipv4.dns-priority 20 && " \
121+
'nmcli connection modify "Wired connection 2" ipv4.dns-priority 10 && ' \
122+
"nmcli device modify #{node.private_interface} ipv4.dns-priority 10"
123123
else
124124
# Wicked: is there a way to give eth1 precedence?
125125
# we use a static setting for the name server instead
126126
static_dns = net_prefix + PRIVATE_ADDRESSES['dhcp_dns']
127127
cmd = 'echo -e "BOOTPROTO=dhcp\nSTARTMODE=auto\n" > /etc/sysconfig/network/ifcfg-eth1 && ' \
128-
'ifup eth1 && ' \
129-
"sed -i 's/^NETCONFIG_DNS_STATIC_SERVERS=\".*\"/NETCONFIG_DNS_STATIC_SERVERS=\"#{static_dns}\"/' /etc/sysconfig/network/config && " \
130-
'netconfig update -f'
128+
'ifup eth1 && ' \
129+
"sed -i 's/^NETCONFIG_DNS_STATIC_SERVERS=\".*\"/NETCONFIG_DNS_STATIC_SERVERS=\"#{static_dns}\"/' /etc/sysconfig/network/config && " \
130+
'netconfig update -f'
131131
end
132132
node.run(cmd)
133133
end

testsuite/features/support/api_test.rb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,13 @@ def initialize(_host)
3838
@token = nil
3939
@semaphore = Mutex.new
4040

41-
file = File.open('api.log', 'a')
42-
file.sync = true
43-
@logger = Logger.new(file)
44-
@logger.level = Logger::INFO
45-
@logger.formatter = proc do |severity, datetime, progname, msg|
46-
"#{datetime.strftime('%H:%M:%S')} [#{severity}] #{msg}\n"
41+
File.open('api.log', 'a') do |file|
42+
file.sync = true
43+
@logger = Logger.new(file)
44+
@logger.level = Logger::INFO
45+
@logger.formatter = proc do |severity, datetime, progname, msg|
46+
"#{datetime.strftime('%H:%M:%S')} [#{severity}] #{msg}\n"
47+
end
4748
end
4849
end
4950

testsuite/features/support/retail.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ def execute_expect_command_proxy(host, exp_file, interface)
9797
mac = $sle15sp7_terminal_mac
9898
end
9999
mac = mac.tr(':', '')
100-
hex = (("#{mac[0..5]}fffe#{mac[6..11]}").to_i(16) ^ 0x0200000000000000).to_s(16)
100+
eui64_base = "#{mac[0..5]}fffe#{mac[6..11]}"
101+
hex = (eui64_base.to_i(16) ^ 0x0200000000000000).to_s(16)
101102
ipv6 = "fe80::#{hex[0..3]}:#{hex[4..7]}:#{hex[8..11]}:#{hex[12..15]}%#{interface}"
102-
103103
source = "#{File.dirname(__FILE__)}/../upload_files/#{exp_file}"
104104
dest = "/tmp/#{exp_file}"
105105
success = file_inject(get_target('proxy'), source, dest)
106106
raise ScriptError, 'File injection failed' unless success
107107

108108
get_target('proxy').run("expect -f /tmp/#{exp_file} #{ipv6}")
109-
end
109+
end

0 commit comments

Comments
 (0)