- How does 'grains.ls' build its list?
- It looks, like it currently simply executes all grain methods and then returns the keys of the resulting dictionary. Simply building the list could be probably done way better, e.g. similar to states/modules returning their virtual name. This would also allow grains to return multiple names for backwards compatibility
While outlining the use-cases below, the following general requirements came up:
Each hook should have its own configuration namespace which allows the hook to read its own RC
values. Not only root-items should be allowed in the hooks RC, so hooks.hookname.some.thing
could
be used instead of hooks.hookname.some_thing
.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -ruN scripts/test/HTMLUtils/LinkQuote.t.orig scripts/test/HTMLUtils/LinkQuote.t | |
--- scripts/test/HTMLUtils/LinkQuote.t.orig 2013-12-01 16:04:54.920957053 +0000 | |
+++ scripts/test/HTMLUtils/LinkQuote.t 2013-12-01 16:07:08.909366227 +0000 | |
@@ -300,6 +300,14 @@ | |
Name => 'LinkQuote - just TLD given;', | |
Target => '', | |
}, | |
+ { | |
+ Input => | |
+ 'http://geizhals.de/?cat=prl&xf=720_LAN+10%2F100~1435_HP~2899_Farblaser~721_Duplexeinheit#xf_top', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import json | |
import os | |
import shutil | |
import subprocess | |
import re | |
dockerdir = '/var/lib/docker' | |
volumesdir = os.path.join(dockerdir, 'volumes') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python-pip: | |
pkg.installed | |
docker-py: | |
pip.installed: | |
- require: | |
- pkg: python-pip | |
# TODO: ensure docker-py is declared a requirement for all dockerio states without having to explicitely declare the requirement in each container state again |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
''' | |
Provide authentication using simple LDAP binds | |
:depends: - ldap Python module | |
''' | |
# Import python libs | |
from __future__ import absolute_import | |
import logging |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Facter.add(:macaddress) do | |
confine :kernel => 'Linux' | |
has_weight 10 # about an order of magnitude faster | |
setcode do | |
begin | |
result = nil | |
Dir.glob('/sys/class/net/*').each do |path| | |
mac = File.read(path + "/address").chomp | |
unless /^(?:00:)+00$|^\s*/.match(mac) | |
result = mac |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/spec/unit/macaddress_spec.rb b/spec/unit/macaddress_spec.rb | |
index 638ef2a..8bc26b1 100755 | |
--- a/spec/unit/macaddress_spec.rb | |
+++ b/spec/unit/macaddress_spec.rb | |
@@ -49,6 +49,15 @@ describe "macaddress fact" do | |
proc { Facter.value(:macaddress) }.should_not raise_error | |
Facter.value(:macaddress).should be_nil | |
end | |
+ | |
+ # when ifconfig isn't installed, nil is returned which should be handled gracefully without any |
NewerOlder