Merge lp:~wesmason/charms/trusty/conn-check/trunk-use-bool into lp:~ubuntuone-hackers/charms/trusty/conn-check/trunk

Proposed by Wes Mason
Status: Merged
Approved by: Wes Mason
Approved revision: 35
Merged at revision: 35
Proposed branch: lp:~wesmason/charms/trusty/conn-check/trunk-use-bool
Merge into: lp:~ubuntuone-hackers/charms/trusty/conn-check/trunk
Diff against target: 47 lines (+3/-14)
2 files modified
filter_plugins/is_true.py (+0/-11)
playbook.yaml (+3/-3)
To merge this branch: bzr merge lp:~wesmason/charms/trusty/conn-check/trunk-use-bool
Reviewer Review Type Date Requested Status
Matt Goodall (community) Approve
Review via email: mp+258849@code.launchpad.net

Commit message

Remove custom is_true filter and use inbuilt bool

Description of the change

Switch custom is_true() filter for Ansible's inbuilt bool() filter [1].

[1] http://docs.ansible.com/playbooks_filters.html#other-useful-filters

To post a comment you must log in.
Revision history for this message
Matt Goodall (matt-goodall) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== removed directory 'filter_plugins'
=== removed file 'filter_plugins/is_true.py'
--- filter_plugins/is_true.py 2015-04-29 10:05:56 +0000
+++ filter_plugins/is_true.py 1970-01-01 00:00:00 +0000
@@ -1,11 +0,0 @@
1class FilterModule(object):
2
3 def filters(self):
4 return {
5 'is_true': self.is_true,
6 }
7
8 def is_true(self, s):
9 # We need this for testing ansible playbook flags, as they're passed
10 # through as strings rather than the actual bool value
11 return bool(str(s).strip().lower() == 'true')
120
=== modified file 'playbook.yaml'
--- playbook.yaml 2015-04-28 21:43:53 +0000
+++ playbook.yaml 2015-05-12 09:10:19 +0000
@@ -66,7 +66,7 @@
66 content: "{{ relations['conn-check'][0]['config'] }}"66 content: "{{ relations['conn-check'][0]['config'] }}"
67 dest: "{{ config_path }}"67 dest: "{{ config_path }}"
68 mode: 060068 mode: 0600
69 when: not (path_provided | is_true) and (config_provided | is_true)69 when: not (path_provided | bool) and (config_provided | bool)
7070
71 - name: Write nagios check command config.71 - name: Write nagios check command config.
72 tags:72 tags:
@@ -79,7 +79,7 @@
79 owner: nagios79 owner: nagios
80 group: nagios80 group: nagios
81 mode: 064481 mode: 0644
82 when: (nagios_enabled | is_true) and (config_or_path_provided | is_true)82 when: (nagios_enabled | bool) and (config_or_path_provided | bool)
8383
84 - name: Write nagios check service definition for export.84 - name: Write nagios check service definition for export.
85 tags:85 tags:
@@ -92,7 +92,7 @@
92 owner: nagios92 owner: nagios
93 group: nagios93 group: nagios
94 mode: 064494 mode: 0644
95 when: (nagios_enabled | is_true) and (config_or_path_provided | is_true)95 when: (nagios_enabled | bool) and (config_or_path_provided | bool)
9696
97 # We only need user/group for the run-check action, as the Nagios user executes checks above97 # We only need user/group for the run-check action, as the Nagios user executes checks above
98 - name: create group98 - name: create group

Subscribers

People subscribed via source and target branches

to all changes: