Age | Commit message (Collapse) | Author | Files | Lines |
|
LoadedFile is now WatchedFile (since it has nothing to do with loading
files, only with telling when they change), and some of its internal
variables have been renamed for clarity. Also added a FileWatcher class
whose entire purpose is to track a set of LoadedFiles in aggregate. This
is now used by TypeCollection in place of its own hash.
Puppet::FileServing::Configuration::Parser and
Puppet::Util::NetworkDevice::Config were inheriting LoadedFile, simply
for its changed? method, even though neither of them really has file
properties. Now they wrap a WatchedFile instance instead.
|
|
The current implementation of the network device enable password parsing
is unable to handle characters like sharps and spaces in the password,
which are valid passwords. This commit adds CGI parsing of the query
string to only extract and unescape the enable query parameter.
This supercedes GH-1327 and GH-1491.
|
|
Commit fe95a39 added a default value of false for instantiation of
network transport types. I omitted that value and defaulted to nil since
they're equivalent but didn't update the tests. This commits checks for
nil instead of false.
|
|
|
|
Without this patch Ruby 1.9 is still complaining loudly about trying to
parse the spec files. The previous attempt to clean up this problem in
edc3ddf works for Ruby 1.8 but not 1.9.
I'd prefer to remove the shebang lines entirely, but doing so will cause
encoding errors in Ruby 1.9. This patch strives for a happy middle
ground of convincing Ruby it is actually working with Ruby while not
confusing it to think it should exec() to rspec.
This patch is the result of the following command run against the source
tree:
find spec -type f -print0 | \
xargs -0 perl -pl -i -e 's,^\#\!\s?/(.*)rspec,\#! /usr/bin/env ruby,'
|
|
Without this patch some spec files are using `ruby -S rspec` and others
are using `rspec`.
We should standardize on a single form of the interpreter used for spec
files.
`ruby -S rspec` is the best choice because it correctly informs editors
such as Vim with Syntastic that the file is a Ruby file rather than an
Rspec file.
|
|
* 2.7.x:
Fix communication_error acceptance test
Use :as_platform in the smf service spec
Use :as_platform in the redhat service spec
(#13690) add comments to spec_helper
(#12392) Don't require eventlog gem on non-Windows platforms
Updating CHANGELOG and lib/puppet.rb for 2.7.13
(#13690) Update 2.7.x for spec_helper compatibility with external projects
(#12392) Add eventlog destination and log to it by default on Windows
Stub mktmpdir and remove_entry_secure in os x package providers
(#13260) Spec test to verify that mktmpdir is used
(#12392) Created Windows eventlog message resource dll
(#13260) Use mktmpdir when downloading packages
Refactor pkgdmg specs
Remove telnet Output_log parameter
Fix for bucket_path security vulnerability
Removed text/marshal support
(#12466) unset X-Forwarded-For header
(#13204) Workaround duplicate Augeas save events
Conflicts:
lib/puppet/util/settings.rb
spec/spec_helper.rb
|
|
The puppet telnet util opened an output log by default with a predictable name.
This left the log open to a write-through symlink attack as the puppet user.
This fix addresses that by removing the Output_log parameter from the
Net::Telnet::new call. Without the parameter, Net::Telnet defaults to no output
logging. The same is true for the dump_log parameter. The spec test for telnet
has been updated to test and ensure that no files are opened during connect. It
also stubs the TCPSocket for the telnet connection so that no connection is
attempted if @transport.connect isn't stubbed.
|
|
Now we have passing tests on Ruby 1.9, we can make all those tags go away and
enable the full suite. Now anything that fails should be treated like a real
failure, which is reasonable since this is a real and supported platform.
Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
|
|
The regex was a little bit too strict and disallowed certnames
containing a dash.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
The interface name abbreviation to canonical name doesn't return
the correct name for GigabitEthernet and doesn't support TenGigabitEthernet
interfaces.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
It was failing when one category (like week, day, hour) was missing.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
Absolute paths on Unix, e.g. /foo/bar, are not absolute on Windows,
which breaks many test cases. This commit adds a method to
PuppetSpec::Files.make_absolute that makes the path absolute in
test cases.
On Unix (Puppet.features.posix?) it is a no-op. On Windows,
(Puppet.features.microsoft_windows?) the drive from the current
working directory is prepended.
Reviewed-by: Jacob Helwig <jacob@puppetlabs.com>
(cherry picked from commit 462a95e3d077b1915a919399b846068816c84583)
Conflicts:
spec/unit/parser/functions/extlookup_spec.rb
|
|
We got rid of the '../../spec_helper' style requires, but a few of them snuck
back in in recent changes. This purges them out, replaced with the header:
#!/usr/bin/env rspec
require 'spec_helper'
Reviewed-By: Nick Lewis <nick@puppetlabs.com>
|
|
By running:
rspec spec --tag ~@fails_on_ruby_1.9.2
We can now just run the specs that pass under Ruby 1.9. Obviously in
the long term we want to have all the specs passing, but until then we
need notification when we regress. From now on new code will be
required to pass under Ruby 1.9, and Jenkins will give us email
notification if it doesn't or if we break something that was already
working.
Reviewed-by: Daniel Pittman <daniel@puppetlabs.com>
|
|
Reviewed-By: Mike Stahnke
|
|
We now use a shebang of: #!/usr/bin/env rspec
This enables the direct execution of spec tests again, which was lost earlier
during the transition to more directly using the rspec2 runtime environment.
|
|
|
|
This allows to manage the global device list of vlans.
Currently supports only cisco IOS devices.
This is as easy as:
Vlan {
device_url => "ssh://user:pass@switch.domain.com/"
}
vlan {
"200": description => "R&D";
"99": description => "Management";
}
The device_url conforms to the same specs as for the interface
type.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
This patch introduces managing remotely cisco IOS network devices
through ssh or telnet with a puppet type/provider.
This patch allows to manage router/switch interface
with the interface type:
interface {
"FastEthernet 0/1":
device_url => "ssh://user:pass@cisco2960.domain.com/",
mode => trunk,
encapsulation => dot1q,
trunk_allowed_vlans => "1-99,200,253",
description => "to back bone router"
}
It is possible with this patch to set interface:
* mode (access or trunk)
* native vlan (only for access mode)
* speed (auto or a given speed)
* duplex (auto, half or full)
* trunk encapsulation
* allowed trunk vlan
* ipv4 addresses
* ipv6 addresses
* etherchannel membership
The interface name (at least for the cisco provider) can be any
shorthand interface name a switch or router can use.
The device url should conform to:
* scheme: either telnet or ssh
* user: can be absent depending on switch/router line config
* pass: must be present
* port: optional
* an optional enable password can be mentioned in the url query string
Ex:
To connect to a switch with a line password and an enable password:
"telnet://:letmein@cisco29224XL.domain.com/?enable=letmeinagain"
To connect to a switch/router through ssh and a privileged user:
"ssh://brice:letmein@cisco1841L.domain.com/"
Note:
This patch only includes a Cisco IOS provider. Also terminology adopted
in the various types are mostly the ones used in Cisco devices.
This patch was tested against:
* (really old) Cisco switch 2924XL with ios 12.0(5)WC10
* Cisco router 1841 with ios 12.4(15)T8
* Cisco router 877 with ios 12.4(11)XJ4
* Cisco switch 2960G with ios 12.2(44)SE
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
It is an adapatation of net-ssh-telnet, so that net-ssh conforms to
a saner interface for consumer.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
It is based on net/telnet.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
This is the base for upcoming telnet and ssh transport mechanism
to send commands to network devices.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
Those will be used to parse IPs, compute netmaks or prefix length.
Unfortunately ruby IPAddr doesn't support those directly.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|