diff --git a/lib/ansible/cli/__init__.py b/lib/ansible/cli/__init__.py index bf5e33e6be8..cffdccb3a9c 100644 --- a/lib/ansible/cli/__init__.py +++ b/lib/ansible/cli/__init__.py @@ -473,13 +473,13 @@ class CLI(object): pass @classmethod - def tty_ify(self, text): + def tty_ify(cls, text): - t = self._ITALIC.sub("`" + r"\1" + "'", text) # I(word) => `word' - t = self._BOLD.sub("*" + r"\1" + "*", t) # B(word) => *word* - t = self._MODULE.sub("[" + r"\1" + "]", t) # M(word) => [word] - t = self._URL.sub(r"\1", t) # U(word) => word - t = self._CONST.sub("`" + r"\1" + "'", t) # C(word) => `word' + t = cls._ITALIC.sub("`" + r"\1" + "'", text) # I(word) => `word' + t = cls._BOLD.sub("*" + r"\1" + "*", t) # B(word) => *word* + t = cls._MODULE.sub("[" + r"\1" + "]", t) # M(word) => [word] + t = cls._URL.sub(r"\1", t) # U(word) => word + t = cls._CONST.sub("`" + r"\1" + "'", t) # C(word) => `word' return t diff --git a/lib/ansible/module_utils/gce.py b/lib/ansible/module_utils/gce.py index 37a4bf1deaf..d3ed90c68b2 100644 --- a/lib/ansible/module_utils/gce.py +++ b/lib/ansible/module_utils/gce.py @@ -28,6 +28,7 @@ # import pprint +from libcloud.compute.providers import get_driver USER_AGENT_PRODUCT="Ansible-gce" USER_AGENT_VERSION="v1" diff --git a/lib/ansible/module_utils/vca.py b/lib/ansible/module_utils/vca.py index 2d4cd39d5bc..b6085354e68 100644 --- a/lib/ansible/module_utils/vca.py +++ b/lib/ansible/module_utils/vca.py @@ -76,7 +76,7 @@ class VcaAnsibleModule(AnsibleModule): gateway_name = self.params['gateway_name'] _gateway = self.vca.get_gateway(vdc_name, gateway_name) if not _gateway: - raise VcaError('vca instance has no gateway named %s' % name) + raise VcaError('vca instance has no gateway named %s' % gateway_name) self._gateway = _gateway return _gateway @@ -84,9 +84,10 @@ class VcaAnsibleModule(AnsibleModule): def vdc(self): if self._vdc is not None: return self._vdc - _vdc = self.vca.get_vdc(self.params['vdc_name']) + vdc_name = self.params['vdc_name'] + _vdc = self.vca.get_vdc(vdc_name) if not _vdc: - raise VcaError('vca instance has no vdc named %s' % name) + raise VcaError('vca instance has no vdc named %s' % vdc_name) self._vdc = _vdc return _vdc diff --git a/lib/ansible/new_inventory/__init__.py b/lib/ansible/new_inventory/__init__.py index b91d9f05a28..4c57edc1613 100644 --- a/lib/ansible/new_inventory/__init__.py +++ b/lib/ansible/new_inventory/__init__.py @@ -21,10 +21,13 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type +import re +import sys from ansible import constants as C from ansible.inventory.group import Group from .host import Host from ansible.plugins.inventory.aggregate import InventoryAggregateParser +from ansible import errors class Inventory: ''' @@ -98,7 +101,7 @@ class Inventory: ''' for group in self._groups: - if group.name == group_name: + if group.name == groupname: return group return None diff --git a/lib/ansible/plugins/inventory/directory.py b/lib/ansible/plugins/inventory/directory.py index 2a2a3c31933..93ef7378b10 100644 --- a/lib/ansible/plugins/inventory/directory.py +++ b/lib/ansible/plugins/inventory/directory.py @@ -47,9 +47,9 @@ class InventoryDirectoryParser(InventoryAggregateParser): if filename in ("host_vars", "group_vars", "vars_plugins"): continue fullpath = os.path.join(directory, filename) - new_names.append(fullpath) + filtered_names.append(fullpath) - super(InventoryDirectoryParser, self).__init__(new_names) + super(InventoryDirectoryParser, self).__init__(filtered_names) def parse(self): return super(InventoryDirectoryParser, self).parse() diff --git a/lib/ansible/plugins/inventory/ini.py b/lib/ansible/plugins/inventory/ini.py index bc6a2bc4894..81601e5606c 100644 --- a/lib/ansible/plugins/inventory/ini.py +++ b/lib/ansible/plugins/inventory/ini.py @@ -47,9 +47,9 @@ class InventoryIniParser(InventoryAggregateParser): if filename in ("host_vars", "group_vars", "vars_plugins"): continue fullpath = os.path.join(directory, filename) - new_names.append(fullpath) + filtered_names.append(fullpath) - super(InventoryDirectoryParser, self).__init__(new_names) + super(InventoryDirectoryParser, self).__init__(filtered_names) def parse(self): return super(InventoryDirectoryParser, self).parse()