Skip to content

Commit b5f536a

Browse files
committed
Drop EoL cisco support
Puppet doesnt support cisco anymore since some time.
1 parent 0807b0c commit b5f536a

15 files changed

Lines changed: 17 additions & 622 deletions

File tree

.rubocop_todo.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2024-05-10 13:25:58 UTC using RuboCop version 1.62.1.
3+
# on 2024-05-10 14:44:46 UTC using RuboCop version 1.62.1.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
@@ -92,14 +92,13 @@ Minitest/RefuteFalse:
9292
- 'acceptance/tests/base/dsl/helpers/host_helpers/check_for_package_test.rb'
9393
- 'acceptance/tests/base/host/host_test.rb'
9494

95-
# Offense count: 20
95+
# Offense count: 19
9696
# Configuration parameters: ForbiddenDelimiters.
9797
# ForbiddenDelimiters: (?i-mx:(^|\s)(EO[A-Z]{1}|END)(\s|$))
9898
Naming/HeredocDelimiterNaming:
9999
Exclude:
100100
- 'Rakefile'
101101
- 'acceptance/tests/base/dsl/helpers/hocon_helpers_test.rb'
102-
- 'lib/beaker/host/cisco.rb'
103102
- 'spec/beaker/host/mac/group_spec.rb'
104103
- 'spec/beaker/host/mac/user_spec.rb'
105104
- 'spec/beaker/host/pswindows/user_spec.rb'
@@ -144,7 +143,7 @@ RSpec/BeEq:
144143
- 'spec/beaker/subcommand/subcommand_util_spec.rb'
145144
- 'spec/beaker/test_suite_spec.rb'
146145

147-
# Offense count: 121
146+
# Offense count: 113
148147
# Configuration parameters: Prefixes, AllowedPatterns.
149148
# Prefixes: when, with, without
150149
RSpec/ContextWording:
@@ -156,7 +155,7 @@ RSpec/Eq:
156155
Exclude:
157156
- 'spec/beaker/logger_spec.rb'
158157

159-
# Offense count: 240
158+
# Offense count: 232
160159
# Configuration parameters: CountAsOne.
161160
RSpec/ExampleLength:
162161
Max: 44
@@ -214,7 +213,7 @@ RSpec/MultipleDescribes:
214213
RSpec/MultipleMemoizedHelpers:
215214
Max: 18
216215

217-
# Offense count: 499
216+
# Offense count: 495
218217
# Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
219218
# SupportedStyles: always, named_only
220219
RSpec/NamedSubject:
@@ -278,7 +277,7 @@ RSpec/SpecFilePathFormat:
278277
- 'spec/beaker/host/windows/user_spec.rb'
279278
- 'spec/beaker/host_prebuilt_steps_spec.rb'
280279

281-
# Offense count: 177
280+
# Offense count: 175
282281
RSpec/SubjectStub:
283282
Exclude:
284283
- 'spec/beaker/dsl/assertions_spec.rb'
@@ -336,7 +335,7 @@ Security/Open:
336335
Exclude:
337336
- 'lib/beaker/dsl/helpers/web_helpers.rb'
338337

339-
# Offense count: 105
338+
# Offense count: 104
340339
# This cop supports safe autocorrection (--autocorrect).
341340
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
342341
# URISchemes: http, https

docs/how_to/hosts/cisco.md

Lines changed: 0 additions & 40 deletions
This file was deleted.

lib/beaker/command.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,7 @@ def cmd_line host, cmd = @command, env = @environment, pc = @prepend_cmds, ac =
7272
append_commands = host.append_commands(cmd, ac, :cmd_exe => @cmdexe)
7373

7474
# This will cause things like `puppet -t -v agent` which is maybe bad.
75-
cmd_line_array = if host[:platform]&.include?('cisco_ios_xr')
76-
[prepend_commands, env_string, cmd, options_string, args_string, append_commands]
77-
else
78-
[env_string, prepend_commands, cmd, options_string, args_string, append_commands]
79-
end
75+
cmd_line_array = [env_string, prepend_commands, cmd, options_string, args_string, append_commands]
8076
cmd_line_array.compact.reject(&:empty?).join(' ')
8177
end
8278

lib/beaker/host.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ def self.create name, host_hash, options
5757
Mac::Host.new name, host_hash, options
5858
when /freebsd/
5959
FreeBSD::Host.new name, host_hash, options
60-
when /cisco/
61-
Cisco::Host.new name, host_hash, options
6260
else
6361
Unix::Host.new name, host_hash, options
6462
end
@@ -574,7 +572,6 @@ def add_env_var(key, val)
574572
freebsd
575573
windows
576574
pswindows
577-
cisco
578575
].each do |lib|
579576
require "beaker/host/#{lib}"
580577
end

lib/beaker/host/cisco.rb

Lines changed: 0 additions & 159 deletions
This file was deleted.

lib/beaker/host/unix/file.rb

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,19 +113,11 @@ def repo_filename(package_name, build_version)
113113
repo_filename = format("pl-%s-%s-", package_name, build_version)
114114

115115
case variant
116-
when /amazon|fedora|el|redhat|centos|cisco_nexus|cisco_ios_xr|opensuse|sles/
116+
when /amazon|fedora|el|redhat|centos|opensuse|sles/
117117
variant = 'el' if %w[centos redhat].include?(variant)
118118

119119
variant = 'redhatfips' if self['packaging_platform']&.include?('redhatfips')
120120

121-
if variant == 'cisco_nexus'
122-
variant = 'cisco-wrlinux'
123-
version = '5'
124-
end
125-
if variant == 'cisco_ios_xr'
126-
variant = 'cisco-wrlinux'
127-
version = '7'
128-
end
129121
fedora_prefix = (variant == 'fedora' ? 'f' : '')
130122

131123
pattern = "%s-%s%s-%s.repo"

lib/beaker/host/unix/pkg.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def check_for_package(name, opts = {})
3737
self[:sles_rpmkeys_nightly_pl_imported] = true
3838
end
3939
result = execute("zypper --gpg-auto-import-keys se -i --match-exact #{name}", opts) { |result| result }
40-
when /amazon|cisco|fedora|centos|redhat|el-/
40+
when /amazon|fedora|centos|redhat|el-/
4141
result = execute("rpm -q #{name}", opts) { |result| result }
4242
when /ubuntu|debian/
4343
result = execute("dpkg -s #{name}", opts) { |result| result }
@@ -85,7 +85,7 @@ def install_package(name, cmdline_args = '', version = nil, opts = {})
8585
when /amazon-2023|el-(8|9|1[0-9])|fedora/
8686
name = "#{name}-#{version}" if version
8787
execute("dnf -y #{cmdline_args} install #{name}", opts)
88-
when /cisco|centos|redhat|el-[1-7]-/
88+
when /centos|redhat|el-[1-7]-/
8989
name = "#{name}-#{version}" if version
9090
execute("yum -y #{cmdline_args} install #{name}", opts)
9191
when /ubuntu|debian/
@@ -167,7 +167,7 @@ def uninstall_package(name, cmdline_args = '', opts = {})
167167
execute("zypper --non-interactive rm #{name}", opts)
168168
when /amazon-2023|el-(8|9|1[0-9])|fedora/
169169
execute("dnf -y #{cmdline_args} remove #{name}", opts)
170-
when /cisco|centos|redhat|el-[1-7]-/
170+
when /centos|redhat|el-[1-7]-/
171171
execute("yum -y #{cmdline_args} remove #{name}", opts)
172172
when /ubuntu|debian/
173173
execute("apt-get purge #{cmdline_args} -y #{name}", opts)
@@ -195,7 +195,7 @@ def upgrade_package(name, cmdline_args = '', opts = {})
195195
execute("zypper --non-interactive --no-gpg-checks up #{name}", opts)
196196
when /fedora-(2[2-9]|3[0-9])/
197197
execute("dnf -y #{cmdline_args} update #{name}", opts)
198-
when /cisco|fedora|centos|redhat|el-/
198+
when /fedora|centos|redhat|el-/
199199
execute("yum -y #{cmdline_args} update #{name}", opts)
200200
when /ubuntu|debian/
201201
update_apt_if_needed

lib/beaker/host_prebuilt_steps.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ def timesync host, opts
5252
ntp_command = "chronyc add server #{ntp_server} prefer trust;chronyc makestep;chronyc burst 1/2"
5353
elsif /opensuse-|sles-/.match?(host['platform'])
5454
ntp_command = "sntp #{ntp_server}"
55-
elsif host['platform'].include?('cisco_nexus')
56-
ntp_server = host.exec(Command.new("getent hosts #{NTPSERVER} | head -n1 |cut -d \" \" -f1"), :acceptable_exit_codes => [0]).stdout
57-
ntp_command = "sudo -E sh -c 'export DCOS_CONTEXT=2;/isan/bin/ntpdate -u -t 20 #{ntp_server}'"
5855
else
5956
ntp_command = "ntpdate -u -t 20 #{ntp_server}"
6057
end
@@ -137,7 +134,7 @@ def host_packages(host)
137134
when /fedora/
138135
FEDORA_PACKAGES
139136
else
140-
if !/aix|solaris|osx-|netscaler|cisco_/.match?(host['platform'])
137+
if !/aix|solaris|osx-|netscaler/.match?(host['platform'])
141138
UNIX_PACKAGES
142139
else
143140
[]

lib/beaker/platform.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module Beaker
33
# all String methods while adding several platform-specific use cases.
44
class Platform < String
55
# Supported platforms
6-
PLATFORMS = /^(alpine|amazon|cisco_nexus|cisco_ios_xr|(free|open)bsd|osx|centos|fedora|debian|oracle|redhat|redhatfips|scientific|opensuse|sles|ubuntu|windows|solaris|aix|archlinux|el|netscaler)\-.+\-.+$/
6+
PLATFORMS = /^(alpine|amazon|(free|open)bsd|osx|centos|fedora|debian|oracle|redhat|redhatfips|scientific|opensuse|sles|ubuntu|windows|solaris|aix|archlinux|el|netscaler)\-.+\-.+$/
77
# Platform version numbers vs. codenames conversion hash
88
PLATFORM_VERSION_CODES =
99
{ :debian => { "forky" => "14",
@@ -58,8 +58,6 @@ class Platform < String
5858
# provided meets the platform formatting rules. Platforms name must be of
5959
# the format /^OSFAMILY-VERSION-ARCH.*$/ where OSFAMILY is one of:
6060
# * amazon
61-
# * cisco_nexus
62-
# * cisco_ios_xr
6361
# * freebsd
6462
# * openbsd
6563
# * osx

0 commit comments

Comments
 (0)