- So to get handlers to work properly you must put the handlers in a different "host" definition.
- hosts: all
roles:
- requires_switchd_restart
- hosts: all
roles:
- system_basics
@mock.patch('library.prefix_check.single_route_check_run') | |
@mock.patch('library.prefix_check.AnsibleModule') | |
def test_route_check_route_found(mock_module, mock_single_run): | |
""" | |
prefix_check - test action when prefix is found | |
""" | |
# on success, single_route_check_run() will return true | |
mock_single_run.return_value = True | |
result = prefix_check.check_if_route_exists(mock_module) |
@mock.patch('library.prefix_check.check_if_route_exists') | |
@mock.patch('library.prefix_check.AnsibleModule') | |
def test_main_exit_functionality_success(mock_module, | |
mock_route_check): | |
""" | |
prefix_check - test_main_exit_functionality - success | |
""" | |
# This creates a instance of the AnsibleModule mock. | |
instance = mock_module.return_value |
import mock | |
import library.prefix_check as prefix_check | |
from nose.tools import assert_equals | |
@mock.patch('library.prefix_check.check_if_route_exists') | |
@mock.patch('library.prefix_check.AnsibleModule') | |
def test_module_args(mock_module, | |
mock_route_check): | |
""" | |
prefix_check - test module arguments |
/** | |
* Wait until the test condition is true or a timeout occurs. Useful for waiting | |
* on a server response or for a ui change (fadeIn, etc.) to occur. | |
* | |
* @param testFx javascript condition that evaluates to a boolean, | |
* it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or | |
* as a callback function. | |
* @param onReady what to do when testFx condition is fulfilled, | |
* it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or | |
* as a callback function. |
DOCUMENTATION = ''' | |
--- | |
module: prefix_check | |
author: Stanley Kamithi [email protected] | |
short_description: Check route prefix | |
description: | |
- Inspired by Cumulus Linux prefix_check Ansible Module. \ | |
Given a route prefix, check to see if route exists. \ | |
If the route exists, then do nothing. If route does not exist \ | |
the module will exit with an error. |
- hosts: all
roles:
- requires_switchd_restart
- hosts: all
roles:
- system_basics
commit 83cd84ddad6d4ebf683cfaa5850dc2dc0b823f2d | |
Author: Stanley Karunditu <[email protected]> | |
Date: Wed Jan 28 00:51:24 2015 -0500 | |
get speed from /sys/class/net instead of ethtool. simpler way of doing it. | |
diff --git a/lib/specinfra/command/linux/base/interface.rb b/lib/specinfra/command/linux/base/interface.rb | |
index 2bb5bec..0ba7efc 100644 | |
--- a/lib/specinfra/command/linux/base/interface.rb | |
+++ b/lib/specinfra/command/linux/base/interface.rb |
cumulus@leaf1$ netshow bond | |
Name Speed Mtu Mode Summary | |
-- ------ ------- ----- ------- ------------------------------- | |
UP bond0 20G 1500 Bond/L3 BondMems: swp1s0(UP) swp1s1(UP) | |
IP: 10.1.2.1/30 | |
cumulus@leaf1$ | |
cumulus@leaf1$ bundle exec rspec | |
Interface "br0" |
diff --git a/lib/serverspec/helper/type.rb b/lib/serverspec/helper/type.rb | |
index 5fcfaae..23d81a0 100644 | |
--- a/lib/serverspec/helper/type.rb | |
+++ b/lib/serverspec/helper/type.rb | |
@@ -2,8 +2,8 @@ module Serverspec | |
module Helper | |
module Type | |
types = %w( | |
- base bridge cgroup command cron default_gateway file fstab group host | |
- iis_website iis_app_pool interface ipfilter ipnat iptables |
I use pymode to modify my python scripts. Keep on getting E501 when length of line is 82 or 83..which I think is just fine.
to fix this did the following
_$HOME/.config/pep8
[pep8]
max-line-length = 90