| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
After some discussion we decided that most uses of the Puppet Face
infrastructure were about single faces on their own, not about the collection,
and so we were better referring to Puppet::Face[...] in code.
This implements that by translating names and references in the Ruby code to
the new, s-less, name.
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
POST with a singular indirection is turned into a find in the indirector.
When making a large find request from a REST terminus, POST is used, and for
small requests, GET is used for backward compatibility.
Paired-With: Jesse Wolfe
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Logically, the extra work around option parsing for faces belongs in the
application parse_options method, not hidden in the step before. This commit
moves that to the right place and fixes the fallout from that strange early
design decision.
Along the way we unify error reporting for invalid options so that all the
code paths result in the same externally detected failures.
Reviewed-By: Matt Robinson <matt@puppetlabs.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The global --help handler (also invoked when puppet is run without any other
command line options at all) used to spit out a brief and generally not so
helpful message.
Now that we have a help face that can provide the same information in a much
more user-friendly form, we should delegate the function to that when
required.
Reviewed-By: Matt Robinson <matt@puppetlabs.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
We used to create temporary directories to have some support files on disk
during testing of faces; we don't really need that most of the time, and this
updates a test to reflect that reality.
Reviewed-By: Matt Robinson <matt@puppetlabs.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously we would only emit help for a face; now we fully integrate legacy
subcommands in the sense that asking for face-level help will emit their
entire help text.
Asking for any action subsequent will raise an error: this is an annoyingly
inconsistent behaviour, but there isn't a saner definition of the change.
Reviewed-By: Matt Robinson <matt@puppetlabs.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
This refactors common code in the tests out, and takes advantage of the
implicit and explicit subject support in rspec2 to make the testing more
expressive and more efficient.
Paired-With: Matt Robinson <matt@puppetlabs.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We used to blink and miss the fact that we failed to load an action or face in
the past; now we test for that, and fail with a clear error message when the
user asks for something we can't deliver.
Additionally, fix a couple of tests that were silently broken because they
passed the wrong arguments, but still got some output.
Paired-With: Matt Robinson <matt@puppetlabs.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Rather than hard-coding the layout of help output in the code, push it out
into external templates. At the moment overriding that would require
changing the ERB code next to puppet/faces/help.rb file on disk.
Paired-With: Matt Robinson <matt@puppetlabs.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
We now emit the summary of actions for an individual face, in the same format
as the summary of available faces. This moves forward through the feature set
defined for the help subcommand.
Reviewed-By: Matt Robinson <matt@puppetlabs.com>
|
| |
| |
| |
| |
| |
| |
| | |
This extends the summary function down through the actions themselves,
allowing us to display a useful summary to the user.
Reviewed-By: Matt Robinson <matt@puppetlabs.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We use a dubious, but effective, regexp match on the existing man(1) style
help string for the application to extract the summary data. This should
properly be implemented as a summary method down in the applications
themselves...
Paired-With: Matt Robinson <matt@puppetlabs.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
We now enumerate and print the list of legacy applications in the unadorned
help action; this allows us a path to migrating forward smoothly while still
providing a good user experience.
Paired-With: Matt Robinson <matt@puppetlabs.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We had two conflicting uses of the list of available faces: in the #face?
method we were perfectly happy to create a top level key on any request, but
didn't populate the version set.
Meanwhile, in #faces we treated the set of top level keys as the absolute and
correct list of all *valid* faces, leading to pain and suffering when people
queried for an invalid face, but then expected to enumerate only valid faces.
Paired-With: Matt Robinson <matt@puppetlabs.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We previously treated the list of legacy commands as an instance property of
Puppet::Util::CommandLine. This made it difficult to obtain that information
outside the context of the instantiated application.
In the longer term this should wither and die as we eliminate the legacy
applications entirely, but until then exposing that on the class is the
lightest mechanism for making that useful.
Paired-With: Matt Robinson <matt@puppetlabs.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
We now use the summary information available in other faces as part of
emitting a list our list of available subcommands. This is seldom used in
faces, but enough emit the information to prove the concept.
Reviewed-By: Matt Robinson <matt@puppetlabs.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
This implements the basic help face, along with the start of the support
structures; we include the basic application, and the default help action that
just emits a listing of faces and other discovered stuff...
Reviewed-By: Matt Robinson <matt@puppetlabs.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This adds the methods to the summary builder and runtime instance to support
setting and getting a summary of the face. This is a short description used
to summarize the purpose of the face in help output.
For example, from the help face:
"Displays help about puppet subcommands"
Reviewed-By: Matt Robinson <matt@puppetlabs.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
We hit another situation where we crudely flushed the internal set of faces,
but require thought we had already loaded the file defining one. This fooled
our autoloader and raised more annoying problems.
Reviewed-By: Matt Robinson <matt@puppetlabs.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Because the implementation is directly an alias to another file, the spec here
is empty. Instead, direct people over to the spec file they should be looking
in. Makes it easier for new developers at pretty much zero cast.
Reviewed-By: Matt Robinson <matt@puppetlabs.com>
|
|/
|
|
|
|
|
|
| |
We didn't do much testing here, which was vaguely reasonable when we didn't
distinguish it from the #define method. Now they are split out we need to be
more careful about testing the right things.
Reviewed-By: Matt Robinson <matt@puppetlabs.com>
|
|
|
|
|
|
|
|
| |
Previously, if a cron entry had "ensure => absent" with no command specified
and the crontab contained unmanaged entries, the entry would fail to be removed
and every other cron entry in the catalog after it would be duplicated.
Paired-With: Jesse Wolfe
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Puppet[:route_file] is a YAML file specifying the termini to use for various
indirections, in the format:
agent:
catalog:
terminus: rest
cache: yaml
master:
catalog:
terminus: compiler
cache: active_record
This file is optional, and will override application defaults set in "setup",
as well as terminus settings, ie. facts_terminus.
Paired-With: Jesse Wolfe
|
|
|
|
|
|
| |
Using warning, the deprecation warnings will appear in logs and in color.
Paired-With: Jesse Wolfe
|
|
|
|
| |
Paired-With: Jesse Wolfe
|
|
|
|
|
|
| |
This fix implements the same logic as Nick & Paul's patch in a different way.
There aren't any tests yet and I'm still working out if I agree with the
handling of some edge cases, so this should be considered premliminary.
|
|
|
|
|
|
|
|
|
|
| |
This patch adds an options hash to lookupvar analogous to the one taken by
setvar and uses it to pass in source location for error reporting. It also
fixes the mechanism used by setvar (file was not being passed correctly), adds
line and file information to errors in templates, and extends/corrects tests.
As presently written it does not gather userful line numbers from inline
templates and there are no tests for the template line number generation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The logic for distinguishing dynamic / static scopes was borrowed from Nick &
Paul's patch, the main differences here being 1) calling it "dynamic" (true/
false) rather than "parent_relationship" (:inherited/:dynamic) 2) aligning the
default so that it only needs to get set in one place (the one that will
eventually go away) and 3) setting it on createion rather than with a setter.
Setting it in one place, on creation, also makes it easier to see that anytime
we access a scope it will have the correct setting of Scope#dynamic and that
this does not change.
This commit also contains a minor refactor (removing Type#subscope) that is not
strictly tied to the main purpose but lies in the direction we are needing to
go and it simplified things to do it now.
|
|
|
|
|
|
|
|
|
| |
This commit adds a method analogous to Puppet.warn which 1) only logs each
message the first time it is received and 2) only logs the first 100 messages
it receives. Messages are logged via warn.
This could easily be made more flexible by making the hard limit and effective
log level user settable, if desired.
|
|
|
|
|
|
|
| |
One of the uses of lookupvar was in the method Scope#strinterp; this method
is no longer used (string interpolation is now handled by the parser (for
the syntax) and AST nodes (for the semantics)) so this use of lookupvar can
be excised, along with a fair amount of surrounding code.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The usestring parameter to lookupvar was objectionable for several reasons;
first, it performed a function orthogonal to the main purpose of the method,
second its default was the least common value, and third it was causing other
code to work for reasons that were not obvious (extlookup).
This refactor breaks the value-transforming function out into a seperate
method which allows the user to specify the value to be used in lieu of :undef
and removes the parameter. The function, Scope#undef_as(default,exp) is
written so that it can be used in user code (templates, functions, etc.) if
needed.
This refactor will introduce a user-visible behaviour change in the case where
users were counting on lookupvar to return "" for undefined variables. The
best solution is to have them use undef_as, replacing:
lookupvar('myvar')
with
undef_as('',lookupvar('myvar'))
(with the option to specify another default value if desired). If this is too
objectionable, we could rename the existing lookupvar as raw_lookupvar and
define
def lookupvar(v)
undef_as('',raw_lookupvar(v))
end
to restore the present behaviour.
|
|
|
|
|
| |
When we lookup a global variable / fact from code we should explicitly look
in the global scope.
|
|
|
|
| |
This attribute is apparently no longer set or accessed.
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If this option is true, a certificate request with the same CN as an existing
certificate will override the existing certificate when signed. With the option
false, the new certificate request will be rejected. This option will default
to false.
Paired-With: Max Martin
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* tickets/master/7021:
Updated confine in Spec test for RSpec 2
Add management of router/switchs global vlans
Cisco Switch/Router Interface management
Base class for network device based providers
Ssh transport for network device management
Telnet transport to connect to remote network device
Remote Network Device transport system
Introduce a module for some IP computations
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This is the common bits of all future network device providers
that are using prefetching/flushing to limit the number of
calls to the remote network device.
The idea is that we need one transaction to prefetch and one
to flush each instance.
Implementors needs to implement lookup which returns a hash
of the found entity, and flush to update the remote device.
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>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
For details of why we're moving please see:
https://groups.google.com/d/topic/puppet-users/NuspYhMpE5o/discussion
Removed explicit GPL licenses where appropriate
Replaced selected GPL licenses with Apache 2.0
Replaced LICENSE with Apache 2.0
Updated README
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
It was previously failing to load at all if couch was missing,
but now it only fails on initialization.
This means that you can tell that the terminus is there when
you're missing couch, but you just can't use it.
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
Reviewed-by: Daniel Pittman <daniel@puppetlabs.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
It only had one available method, and the errors incorrectly
specified what it was.
This just defaults to listing all the time, and I've updated
the docs to be correct, too.
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
Reviewed-by: Daniel Pittman <daniel@puppetlabs.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
ActiveRecord::StatementInvalid: SQLite3::IOException: disk I/O error
This happened if you ran these tests in the following order since Rails
wasn't disconnecting between tests.
rspec spec/unit/indirector/facts/inventory_active_record_spec.rb
spec/unit/indirector/node/active_record_spec.rb
Paired-with: Nick Lewis <nick@puppetlabs.com>
|