From 04e7073acae1dacc3aa1127115427ae2461ab60b Mon Sep 17 00:00:00 2001 From: yumaojun <719118794@qq.com> Date: Wed, 18 Nov 2015 19:03:13 +0800 Subject: [PATCH] 1. fixed ansible api auto load local host file (/etc/ansible/hosts) bug with null list --- jperm/ansible_api.py | 4 ++-- jperm/playbooks/ansible_need.txt | 0 2 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 jperm/playbooks/ansible_need.txt diff --git a/jperm/ansible_api.py b/jperm/ansible_api.py index 1f3774e61..3a8b50c61 100644 --- a/jperm/ansible_api.py +++ b/jperm/ansible_api.py @@ -15,9 +15,9 @@ from utils import get_rand_pass import os.path + API_DIR = os.path.dirname(os.path.abspath(__file__)) ANSIBLE_DIR = os.path.join(API_DIR, 'playbooks') -NULL_FILE = os.path.join(ANSIBLE_DIR, 'ansible_need.txt') @@ -62,7 +62,7 @@ class MyInventory(object): [{"hostname": "10.10.10.10", "port": "22", "username": "test", "password": "mypass"}, ...] """ self.resource = resource - self.inventory = Inventory(host_list=NULL_FILE) + self.inventory = Inventory(host_list=[]) self.gen_inventory() def add_group(self, hosts, groupname, groupvars=None): diff --git a/jperm/playbooks/ansible_need.txt b/jperm/playbooks/ansible_need.txt deleted file mode 100644 index e69de29bb..000000000