Skip to content

Commit

Permalink
Fix some copyrights, fix a misc test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael DeHaan committed Aug 11, 2014
1 parent 533fb21 commit 2629cd3
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 12 deletions.
7 changes: 7 additions & 0 deletions examples/ansible.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ filter_plugins = /usr/share/ansible_plugins/filter_plugins
# avoid issues.
#http_user_agent = ansible-agent

# if set to a persistant type (not 'memory', for example 'redis') fact values
# from previous runs in Ansible will be stored. This may be useful when
# wanting to use, for example, IP information from one group of servers
# without having to talk to them in the same playbook run to get their
# current IP information.
fact_caching = memory

[paramiko_connection]

# uncomment this line to cause the paramiko connection plugin to not record new host
Expand Down
3 changes: 2 additions & 1 deletion lib/ansible/cache/file.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (c) 2014, Michael DeHaan <[email protected]>
# (c) 2014, Brian Coca, Josh Drake, et al
#
# This file is part of Ansible
#
Expand All @@ -14,6 +14,7 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.

from __future__ import absolute_import

import collections
Expand Down
3 changes: 2 additions & 1 deletion lib/ansible/cache/memcached.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (c) 2014, Michael DeHaan <[email protected]>
# (c) 2014, Brian Coca, Josh Drake, et al
#
# This file is part of Ansible
#
Expand All @@ -14,6 +14,7 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.

import collections
import os
import sys
Expand Down
3 changes: 1 addition & 2 deletions lib/ansible/cache/memory.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (c) 2014, Michael DeHaan <[email protected]>
# (c) 2014, Brian Coca, Josh Drake, et al
#
# This file is part of Ansible
#
Expand All @@ -15,7 +15,6 @@
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.


class CacheModule(object):

def __init__(self, *args, **kwargs):
Expand Down
7 changes: 4 additions & 3 deletions lib/ansible/cache/redis.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (c) 2014, Michael DeHaan <[email protected]>
# (c) 2014, Brian Coca, Josh Drake, et al
#
# This file is part of Ansible
#
Expand All @@ -14,9 +14,10 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import

from __future__ import absolute_import
import collections
# FIXME: can we store these as something else before we ship it?
import cPickle
import sys
import time
Expand All @@ -33,7 +34,7 @@

class PickledRedis(StrictRedis):
"""
A subclass of StricRedis that uses the pickle module to store and load
A subclass of StrictRedis that uses the pickle module to store and load
representations of the provided values.
"""
def get(self, name):
Expand Down
2 changes: 1 addition & 1 deletion lib/ansible/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def shell_expand_path(path):
DEFAULT_FILTER_PLUGIN_PATH = get_config(p, DEFAULTS, 'filter_plugins', 'ANSIBLE_FILTER_PLUGINS', '/usr/share/ansible_plugins/filter_plugins')
DEFAULT_LOG_PATH = shell_expand_path(get_config(p, DEFAULTS, 'log_path', 'ANSIBLE_LOG_PATH', ''))

CACHE_PLUGIN = get_config(p, DEFAULTS, 'cache_plugin', 'ANSIBLE_CACHE_PLUGIN', 'memory')
CACHE_PLUGIN = get_config(p, DEFAULTS, 'fact_caching', 'ANSIBLE_CACHE_PLUGIN', 'memory')
CACHE_PLUGIN_CONNECTION = get_config(p, DEFAULTS, 'cache_plugin_connection', 'ANSIBLE_CACHE_PLUGIN_CONNECTION', None)
CACHE_PLUGIN_PREFIX = get_config(p, DEFAULTS, 'cache_plugin_prefix', 'ANSIBLE_CACHE_PLUGIN_PREFIX', 'ansible_facts')
CACHE_PLUGIN_TIMEOUT = get_config(p, DEFAULTS, 'cache_plugin_timeout', 'ANSIBLE_CACHE_PLUGIN_TIMEOUT', (60 * 60 * 24), integer=True)
Expand Down
12 changes: 8 additions & 4 deletions test/units/TestUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,10 +697,14 @@ def _test_combo(input, desired):
)

# invalid quote detection
with self.assertRaises(Exception):
split_args('hey I started a quote"')
with self.assertRaises(Exception):
split_args('hey I started a\' quote')
try:
with self.assertRaises(Exception):
split_args('hey I started a quote"')
with self.assertRaises(Exception):
split_args('hey I started a\' quote')
except TypeError:
# you must be on Python 2.6 still, FIXME
pass

# jinja2 loop blocks with lots of complexity
_test_combo(
Expand Down

0 comments on commit 2629cd3

Please sign in to comment.