lak / puppet-interfaces Goto Github PK
View Code? Open in Web Editor NEWDramatically better CLI tools for interacting with Puppet
License: Other
Dramatically better CLI tools for interacting with Puppet
License: Other
The fact that actions are defined globally bothers me, this appears to make it extremely difficult to write helper methods associated with actions (or should I store all of my helper methods somewhere else?).
Did you have something in mind for this?
I found that I want to customize how the application renders results from interfaces for every application that I am working on.
the following code:
render_method = Puppet::Network::FormatHandler.format(format).render_method puts result.send(render_method) if result
cannot handle the rendering of whatever arbitrary data types actions may return.
As a general rule
Hi Luke,
We talked about moving some of my actions from their own custom interfaces to just be plugins of one of your existing interface. This is problematic b/c my actions have custom rendering that would need to be added as a plugin to the application.
If we support plugin actions, then we should also have a way to customize rendering of those applications.
I get the following error when I try to upload facts
[root@mypuppetmaster tests]# puppet agent -t info: Loading facts in iscsi_initiatorname info: Loading facts in iscsi_initiatorname info: Loading facts in iscsi_initiatorname info: Loading facts in iscsi_initiatorname info: Caching catalog for puppetclient info: Applying configuration version '1299064057' notice: CentOS notice: /Stage[main]//Node[default]/Notify[CentOS]/message: defined 'message' as 'CentOS' notice: Finished catalog run in 0.05 seconds [root@mypuppetmaster tests]# puppet facts upload err: Cached facts for mypuppetmaster.localdomain failed: certificate verify failed /usr/lib/ruby/1.8/net/http.rb:586:in `connect': certificate verify failed (OpenSSL::SSL::SSLError) from /usr/lib/ruby/1.8/net/http.rb:586:in `connect' from /usr/lib/ruby/1.8/net/http.rb:553:in `do_start' from /usr/lib/ruby/1.8/net/http.rb:542:in `start' from /usr/lib/ruby/1.8/net/http.rb:1035:in `request' from /usr/lib/ruby/1.8/net/http.rb:857:in `put' from /usr/local/dev/puppet/lib/puppet/indirector/rest.rb:107:in `save' from /usr/local/dev/puppet/lib/puppet/indirector/indirection.rb:192:in `find' from /usr/local/dev/puppet-interfaces/lib/puppet/interface/facts.rb:11:in `upload' from /usr/local/dev/puppet-interfaces/lib/puppet/application/interface_base.rb:46:in `send' from /usr/local/dev/puppet-interfaces/lib/puppet/application/interface_base.rb:46:in `main' from /usr/local/dev/puppet/lib/puppet/application.rb:312:in `run_command' from /usr/local/dev/puppet/lib/puppet/application.rb:304:in `run' from /usr/local/dev/puppet/lib/puppet/application.rb:410:in `exit_on_fail' from /usr/local/dev/puppet/lib/puppet/application.rb:304:in `run' from /usr/local/dev/puppet/lib/puppet/util/command_line.rb:59:in `execute' from /usr/local/dev/puppet//bin/puppet:4
puppet interface list ... test: Terminuses: Actions: check_tests, compile_tests, showconfig ...
# puppet test showconfig /usr/local/dev/puppet-interfaces/lib/puppet/interface.rb:87:in `showconfig': undefined local variable or method `indirection' for # (NameError) from /usr/local/dev/puppet-interfaces/lib/puppet/application/interface_base.rb:46:in `send' from /usr/local/dev/puppet-interfaces/lib/puppet/application/interface_base.rb:46:in `main' from /usr/local/dev/puppet/lib/puppet/application.rb:312:in `run_command' from /usr/local/dev/puppet/lib/puppet/application.rb:304:in `run' from /usr/local/dev/puppet/lib/puppet/application.rb:410:in `exit_on_fail' from /usr/local/dev/puppet/lib/puppet/application.rb:304:in `run' from /usr/local/dev/puppet/lib/puppet/util/command_line.rb:59:in `execute' from /usr/local/dev/puppet//bin/puppet:4
Currently it is completely unsorted (hash keys ordering?). It would be nice (if not possible to sort in the order they were tested) for them to be at least alphabetically sorted so you can find files in the output a bit easier.
"#Puppet::Node:0xb7b01dfc"
I get the following error when I try to pass more than one argument through my application.
# puppet diff catalog /var/lib/puppet/tests/motd-init.pp.pson /var/lib/puppet/tests/motd-init.pp2.pson --trace /usr/local/dev/puppet-interface-utils/lib/puppet/interface/diff.rb:9:in `catalog': undefined method `shift' for "/var/lib/puppet/tests/motd-init.pp.pson":String (NoMethodError) from /usr/local/dev/puppet-interfaces/lib/puppet/application/interface_base.rb:46:in `send' from /usr/local/dev/puppet-interfaces/lib/puppet/application/interface_base.rb:46:in `main' from /usr/local/dev/puppet/lib/puppet/application.rb:312:in `run_command' from /usr/local/dev/puppet/lib/puppet/application.rb:304:in `run' from /usr/local/dev/puppet/lib/puppet/application.rb:410:in `exit_on_fail' from /usr/local/dev/puppet/lib/puppet/application.rb:304:in `run' from /usr/local/dev/puppet/lib/puppet/util/command_line.rb:59:in `execute' from /usr/local/dev/puppet//bin/puppet:4
inside of preinit, it makes sense to catch this signal and exit anyways
options set at the command line should be passed to the interface constructor.
@interface = Puppet::Interface.interface(@type).new(@options)
Hi Luke,
The most important thing to figure out next is documentation, this will make adoption a lot easer.
we should be able to do something like:
puppet interface catalog --help
puppet interface catalog find --help
and get back the relevent docs
I need to refactor the application code to allow non-indirector applications
/usr/local/dev/puppet-interfaces/lib/puppet/application/data_baseclass.rb:50:in main': undefined method
render' for #Array:0xb7b03724 (NoMethodError)
from /usr/local/dev/puppet//lib/puppet/application.rb:312:in run_command' from /usr/local/dev/puppet//lib/puppet/application.rb:304:in
run'
from /usr/local/dev/puppet//lib/puppet/application.rb:410:in exit_on_fail' from /usr/local/dev/puppet//lib/puppet/application.rb:304:in
run'
from /usr/local/dev/puppet//lib/puppet/util/command_line.rb:59:in `execute'
from /usr/local/dev/puppet//bin/puppet:4
as discussed, I am going to patch this by creating a new class
Puppet::Interface::Indirector < Puppet::Interface
this way interfaces that are not backed by indirectors can just inherit from Puppet::Interface
I have use cases where an interface may render differently based on the action
I added @exit_code to the base application class.
# puppet interface list catalog: Terminuses: active_record, compiler, queue, rest, yaml Actions: destroy, find, save, search, select, showconfig certificate: Terminuses: ca, file, rest Actions: destroy, find, save, search, showconfig certificate_request: Terminuses: ca, file, rest Actions: destroy, find, save, search, showconfig certificate_revocation_list: Terminuses: ca, file, rest Actions: destroy, find, save, search, showconfig facts: Terminuses: active_record, couch, facter, memory, rest, yaml Actions: destroy, find, save, search, showconfig, upload Unable to find interface 'file_bucket_file': no such file to load -- puppet/interface/file_bucket_file.
there are two issues with this:
how can I add extra command line options for custom actions?
I am leaning further towards not writing any action plugins.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.