1. fixed ansible api auto load local host file (/etc/ansible/hosts) bug with null list

pull/26/head
yumaojun 2015-11-18 19:03:13 +08:00
parent 2ccd072416
commit 04e7073aca
2 changed files with 2 additions and 2 deletions

View File

@ -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):