Age | Commit message (Collapse) | Author |
|
unsure if we really should, or just raise the error and let consumer of
fetch decide what to do with the error
|
|
Also if group was explicitly given, we referred to wrong directory
|
|
in commit `de2a9d1` I changed the `#fetch` method to pass the
`Node` object instead of the node name.
|
|
so that
```
output:
file:
directory: ~/foox
```
will work
|
|
|
|
|
|
|
|
|
|
|
|
If no output file is found, return nil.
Previously, it would try to find the output file by doing a recursive glob search in the config dir. It would then try to open the file for reading regardless of whether any file was found.
I ran into this when I fired up oxidized for the first time and tried to access a switch config on oxidized-web before it had a chance to collect it.
In this scenario, you get a stack trace on the switch config page (e.g. `http://oxidized.example.com:8888/node/fetch/switch-001.example.com`):
```
Puma caught this error: undefined method `join' for #<String:0x007f3a3c4283f8> (NoMethodError)
/usr/lib64/ruby/gems/2.2.0/gems/sinatra-1.4.5/lib/sinatra/show_exceptions.rb:37:in `rescue in call'
/usr/lib64/ruby/gems/2.2.0/gems/sinatra-1.4.5/lib/sinatra/show_exceptions.rb:21:in `call'
/usr/lib64/ruby/gems/2.2.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:180:in `call'
/usr/lib64/ruby/gems/2.2.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:2014:in `call'
/usr/lib64/ruby/gems/2.2.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1478:in `block in call'
/usr/lib64/ruby/gems/2.2.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1788:in `synchronize'
/usr/lib64/ruby/gems/2.2.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1478:in `call'
/usr/lib64/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/urlmap.rb:66:in `block in call'
/usr/lib64/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/urlmap.rb:50:in `each'
/usr/lib64/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/urlmap.rb:50:in `call'
/usr/lib64/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/builder.rb:153:in `call'
/usr/lib64/ruby/gems/2.2.0/gems/puma-2.11.1/lib/puma/server.rb:507:in `handle_request'
/usr/lib64/ruby/gems/2.2.0/gems/puma-2.11.1/lib/puma/server.rb:375:in `process_client'
/usr/lib64/ruby/gems/2.2.0/gems/puma-2.11.1/lib/puma/server.rb:262:in `block in run'
/usr/lib64/ruby/gems/2.2.0/gems/puma-2.11.1/lib/puma/thread_pool.rb:104:in `call'
/usr/lib64/ruby/gems/2.2.0/gems/puma-2.11.1/lib/puma/thread_pool.rb:104:in `block in spawn_thread'
```
|
|
- now default type is 'nil', which is collapsed to flat config via
Outputs#to_cfg
- if type is not 'nil' then name is automatically set if not set by
model
- if name and type is set, separate file is created
- if name is not set, but type is set, outputs from type are collapsed
as with 'nil' types
This model:
cmd 'show ip cef' do |out|
out.type = 'poop'
out.name = false
out
end
cmd 'show process cpu' do |out|
out.type = 'poop'
out.name = 'my_cpu'
out
end
cmd 'show memory statistics' do |out|
out.type = 'poop'
out.name = false
out
end
cmd 'show ip bgp summary' do |out|
out.type = 'poop'
end
Would produce git output:
[ytti@ytti.fi ~/.config/oxidized]% ls poop
bu.ip.fi bu.ip.fi--cpu bu.ip.fi--show_ip_bgp_summary
[ytti@ytti.fi ~/.config/oxidized]%
bu.ip.fi contains the collapsed stuff
bu.ip.fi--cpu is manually named
bu.ip.fi--show_ip_bgp_summary is automatically named
|
|
In new method, where we no long explicitly set loaded class name for
later resolution we depend on file name being same as class name.
However for File output, this is not true, because I didn't want plain
File in code to resolve to Oxidized::File, and din't want to always
write ::File, File ouput has class name OxFile.
This change allows class names to start optionally with string
'Oxidized' if so, they still match.
|
|
Main benefits
a) we get support for system wide configs
b) we don't use symbols in config file, they're confusing to
non-rubyist
|
|
As I can't do IO#select on sinatra/puma to run it when I have time, I
have to run it on separate thread.
This means Nodes container needs to be thread safe, it now has ghetto
mutex locking, but I probably need to be be more focused what are the
external methods that can be called and wrap those in @mutex.synchronize
Provide also HTML UI not just JSON for ghetto UI to people who don't want to
integrate
|
|
|
|
|
|
|
|
|
|
|
|
|
|
'store' is more logical, as we cannot know if output method guarantees
any version history which 'update' implies.
|
|
Silly for shit-and-giggles attempt at rancid
|