Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am jamesc on github.
  • I am jamesc (https://keybase.io/jamesc) on keybase.
  • I have a public key whose fingerprint is 41D8 EFB5 E3FA 972A AEA0 4FC6 966D B723 C86F 6443

To claim this, I am signing this object:

Proceeding with analysis...
ls_log.erl:22: Type specification ls_log:'#info-'('log') -> ['count' | 'created_at' | 'id' | 'node_name' | 'organization_name' | 'run_id'] is a supertype of the success typing: ls_log:'#info-'('log') -> ['count' | 'created_at' | 'id' | 'node_name' | 'organization_name' | 'run_id',...]
ls_log.erl:22: Type specification ls_log:'#info-log'('fields') -> ['count' | 'created_at' | 'id' | 'node_name' | 'organization_name' | 'run_id']
; ('size') -> 7 is a supertype of the success typing: ls_log:'#info-log'('fields' | 'size') -> ['count' | 'created_at' | 'id' | 'node_name' | 'organization_name' | 'run_id',...] | 7
ls_log.erl:22: Type specification ls_log:'#pos-log'('#attr-log'() | atom()) -> integer() is a supertype of the success typing: ls_log:'#pos-log'(atom()) -> 0 | 2 | 3 | 4 | 5 | 6 | 7
ls_log.erl:22: The specification for ls_log:'#pos-'/2 states that the function might also return 1 but the inferred return is 0 | 2 | 3 | 4 | 5 | 6 | 7
ls_log.erl:22: Type specification ls_log:'#i
@jamesc
jamesc / gist:1106560
Created July 26, 2011 11:48
Auto-deploy nagios plugins (from the chef cookbook)
remote_directory "/usr/lib/nagios/plugins" do
source "plugins"
owner "nagios"
group "nagios"
mode 0755
files_mode 0755
end
not_found_cookbooks(AllVersions, Cookbooks) ->
case lists:filter(fun(CB) -> cookbook_exists(CB, AllVersions) end, Cookbooks) of
[] -> ok;
NotFound -> {not_found, [ cookbook_name(NFCookbook) || NFCookbook <- NotFound] }
end.
Can become :
not_found_cookbooks(AllVersions, Cookbooks) ->
NotFound = [ cookbook_name(Cookbook) || Cookbook <- Cookbooks, cookbook_exists(Cookbook, AllVersions)],
/srv/piab/mounts/chef-pedant-core/lib/pedant/requestor.rb:23:in `read': can't convert nil into String (TypeError)
from /srv/piab/mounts/chef-pedant-core/lib/pedant/requestor.rb:23:in `initialize'
from /srv/piab/mounts/chef-pedant-core/lib/pedant/requestor.rb:51:in `initialize'
from /srv/piab/mounts/chef-pedant-core/lib/pedant/opensource/platform.rb:66:in `new'
from /srv/piab/mounts/chef-pedant-core/lib/pedant/opensource/platform.rb:66:in `create_client'
from /srv/piab/mounts/chef-pedant-core/lib/pedant/opensource/platform.rb:77:in `client_from_config'
from /srv/piab/mounts/chef-pedant-core/lib/pedant/opensource/platform.rb:27:in `block in setup'
from /srv/piab/mounts/chef-pedant-core/lib/pedant/opensource/platform.rb:19:in `each'
from /srv/piab/mounts/chef-pedant-core/lib/pedant/opensource/platform.rb:19:in `setup'
from /srv/piab/mounts/chef-pedant-core/lib/pedant.rb:86:in `block (2 levels) in configure_rspec'
=SUPERVISOR REPORT==== 28-Aug-2012::21:50:32 ===
Supervisor: {local,stats_hero_worker_sup}
Context: child_terminated
Reason: {function_clause,
[{stats_hero,as_bin,
['open-source-chef'],
[{file,"src/stats_hero.erl"},{line,582}]},
{stats_hero,init,1,
[{file,"src/stats_hero.erl"},{line,269}]},
{gen_server,init_it,6,
Failures:
1) Cookbooks API endpoint PUT /cookbooks/<name>/<version> [update] for checksums adding all new checksums should succeed
Failure/Error: Unable to find matching line from backtrace
'files' should match '[{"name"=>"name1", "path"=>"path/name1", "checksum"=>"f33abe1e61a77e1dd298d3201b8748e1", "specificity"=>"default", "url"=>"https://open-source-chef.opscode.piab/cookbooks/cookbook-to-be-modified/11.2.3/files/f33abe1e61a77e1dd298d3201b8748e1"}, {"name"=>"name2", "path"=>"path/name2", "checksum"=>"07a57179ba512d3b97e4544e59abc45b", "specificity"=>"default", "url"=>"https://open-source-chef.opscode.piab/cookbooks/cookbook-to-be-modified/11.2.3/files/07a57179ba512d3b97e4544e59abc45b"}, {"name"=>"name3", "path"=>"path/name3", "checksum"=>"c54d9a1740973cf2fba2f6ee68e93f5d", "specificity"=>"default", "url"=>"https://open-source-chef.opscode.piab/cookbooks/cookbook-to-be-modified/11.2.3/files/c54d9a1740973cf2fba2f6ee68e93f5d"}, {"name"=>"name4", "path"=>"path/name4", "checksum"=>"5a6dc49ff61dad
root@open-source-chef:/tmp/apt-1.4.3# hexdump -C providers/preference.rb |head
00000000 36 37 39 0d 0a 23 0a 23 20 43 6f 6f 6b 62 6f 6f |679..#.# Cookboo|
00000010 6b 20 4e 61 6d 65 3a 3a 20 61 70 74 0a 23 20 50 |k Name:: apt.# P|
00000020 72 6f 76 69 64 65 72 3a 3a 20 70 72 65 66 65 72 |rovider:: prefer|
00000030 65 6e 63 65 0a 23 0a 23 20 43 6f 70 79 72 69 67 |ence.#.# Copyrig|
00000040 68 74 20 32 30 31 30 2d 32 30 31 31 2c 20 4f 70 |ht 2010-2011, Op|
00000050 73 63 6f 64 65 2c 20 49 6e 63 2e 0a 23 0a 23 20 |scode, Inc..#.# |
00000060 4c 69 63 65 6e 73 65 64 20 75 6e 64 65 72 20 74 |Licensed under t|
00000070 68 65 20 41 70 61 63 68 65 20 4c 69 63 65 6e 73 |he Apache Licens|
...
Failures:
1) Environments API Endpoint POST /environments with no additional environments when handling the payload with authentication headers when X-Ops-Request-Source is web impersonating successful user succeeds
Failure/Error: let(:user) { Pedant::Requestor.new(success_user.name, '/etc/chef-server/webui_priv.pem') }
Errno::ENOENT:
No such file or directory - /etc/chef-server/webui_priv.pem
# /srv/piab/mounts/chef-pedant-core/lib/pedant/requestor.rb:30:in `read'
# /srv/piab/mounts/chef-pedant-core/lib/pedant/requestor.rb:30:in `initialize'
# /srv/piab/mounts/chef-pedant-core/lib/pedant/rspec/auth_headers_util.rb:276:in `new'
# /srv/piab/mounts/chef-pedant-core/lib/pedant/rspec/auth_headers_util.rb:276:in `block (4 levels) in <module:AuthHeadersUtil>'
# /srv/piab/mounts/chef-pedant-core/lib/pedant/rspec/auth_headers_util.rb:109:in `block (2 levels) in <module:AuthHeadersUtil>'