From cf9ddf3a3084a330581dd7241b5993dcdd3d5ee2 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Fri, 25 May 2012 19:34:13 -0400 Subject: [PATCH] Reorganizing file structure. Not done. --- lib/ansible/{inventory.py => inventory/__init__.py} | 12 ++++++------ lib/ansible/{ => inventory}/group.py | 0 lib/ansible/{ => inventory}/host.py | 0 .../{inventory_parser.py => inventory/ini.py} | 6 +++--- .../{inventory_script.py => inventory/script.py} | 7 +++---- .../{inventory_parser_yaml.py => inventory/yaml.py} | 6 +++--- lib/ansible/{playbook.py => playbook/__init__.py} | 0 lib/ansible/{runner.py => runner/__init__.py} | 6 +++--- lib/ansible/{ => runner}/connection.py | 0 lib/ansible/{ => runner}/poller.py | 0 10 files changed, 18 insertions(+), 19 deletions(-) rename lib/ansible/{inventory.py => inventory/__init__.py} (95%) rename lib/ansible/{ => inventory}/group.py (100%) rename lib/ansible/{ => inventory}/host.py (100%) rename lib/ansible/{inventory_parser.py => inventory/ini.py} (97%) rename lib/ansible/{inventory_script.py => inventory/script.py} (94%) rename lib/ansible/{inventory_parser_yaml.py => inventory/yaml.py} (97%) rename lib/ansible/{playbook.py => playbook/__init__.py} (100%) rename lib/ansible/{runner.py => runner/__init__.py} (99%) rename lib/ansible/{ => runner}/connection.py (100%) rename lib/ansible/{ => runner}/poller.py (100%) diff --git a/lib/ansible/inventory.py b/lib/ansible/inventory/__init__.py similarity index 95% rename from lib/ansible/inventory.py rename to lib/ansible/inventory/__init__.py index 09c23bb0fe..7c5248896a 100644 --- a/lib/ansible/inventory.py +++ b/lib/ansible/inventory/__init__.py @@ -20,13 +20,13 @@ import fnmatch import os -import constants as C import subprocess -from ansible.inventory_parser import InventoryParser -from ansible.inventory_parser_yaml import InventoryParserYaml -from ansible.inventory_script import InventoryScript -from ansible.group import Group -from ansible.host import Host +import ansible.constants as C +from ansible.inventory.ini import InventoryParser +from ansible.inventory.yaml import InventoryParserYaml +from ansible.inventory.script import InventoryScript +from ansible.inventory.group import Group +from ansible.inventory.host import Host from ansible import errors from ansible import utils diff --git a/lib/ansible/group.py b/lib/ansible/inventory/group.py similarity index 100% rename from lib/ansible/group.py rename to lib/ansible/inventory/group.py diff --git a/lib/ansible/host.py b/lib/ansible/inventory/host.py similarity index 100% rename from lib/ansible/host.py rename to lib/ansible/inventory/host.py diff --git a/lib/ansible/inventory_parser.py b/lib/ansible/inventory/ini.py similarity index 97% rename from lib/ansible/inventory_parser.py rename to lib/ansible/inventory/ini.py index 3a086af078..64bc778511 100644 --- a/lib/ansible/inventory_parser.py +++ b/lib/ansible/inventory/ini.py @@ -21,9 +21,9 @@ import fnmatch import os import subprocess -import constants as C -from ansible.host import Host -from ansible.group import Group +import ansible.constants as C +from ansible.inventory.host import Host +from ansible.inventory.group import Group from ansible import errors from ansible import utils diff --git a/lib/ansible/inventory_script.py b/lib/ansible/inventory/script.py similarity index 94% rename from lib/ansible/inventory_script.py rename to lib/ansible/inventory/script.py index 8c4a78b125..8d0f16a214 100644 --- a/lib/ansible/inventory_script.py +++ b/lib/ansible/inventory/script.py @@ -19,10 +19,9 @@ import os import subprocess -import constants as C -import os -from ansible.host import Host -from ansible.group import Group +import ansible.constants as C +from ansible.inventory.host import Host +from ansible.inventory.group import Group from ansible import errors from ansible import utils diff --git a/lib/ansible/inventory_parser_yaml.py b/lib/ansible/inventory/yaml.py similarity index 97% rename from lib/ansible/inventory_parser_yaml.py rename to lib/ansible/inventory/yaml.py index bdf69b17c3..a9d14457e5 100644 --- a/lib/ansible/inventory_parser_yaml.py +++ b/lib/ansible/inventory/yaml.py @@ -17,9 +17,9 @@ ############################################# -import constants as C -from ansible.host import Host -from ansible.group import Group +import ansible.constants as C +from ansible.inventory.host import Host +from ansible.inventory.group import Group from ansible import errors from ansible import utils diff --git a/lib/ansible/playbook.py b/lib/ansible/playbook/__init__.py similarity index 100% rename from lib/ansible/playbook.py rename to lib/ansible/playbook/__init__.py diff --git a/lib/ansible/runner.py b/lib/ansible/runner/__init__.py similarity index 99% rename from lib/ansible/runner.py rename to lib/ansible/runner/__init__.py index e1ce28d3e7..a263544944 100644 --- a/lib/ansible/runner.py +++ b/lib/ansible/runner/__init__.py @@ -32,11 +32,11 @@ import getpass import codecs import ansible.constants as C -import ansible.connection +import connection import ansible.inventory from ansible import utils from ansible import errors -from ansible import poller +from ansible.runner import poller from ansible import callbacks as ans_callbacks HAS_ATFORK=True @@ -153,7 +153,7 @@ class Runner(object): self.sudo_user = sudo_user self.transport = transport - self.connector = ansible.connection.Connection(self, self.transport, self.sudo_user) + self.connector = connection.Connection(self, self.transport, self.sudo_user) if inventory is None: self.inventory = ansible.inventory.Inventory(host_list) diff --git a/lib/ansible/connection.py b/lib/ansible/runner/connection.py similarity index 100% rename from lib/ansible/connection.py rename to lib/ansible/runner/connection.py diff --git a/lib/ansible/poller.py b/lib/ansible/runner/poller.py similarity index 100% rename from lib/ansible/poller.py rename to lib/ansible/runner/poller.py