Merging chrismeyers's openstack work branch changes to the core

openstack module.  Adding python-netifaces dependency for setup packaging
This commit is contained in:
Matthew Jones 2015-04-13 11:47:18 -04:00
parent 768d9d65b9
commit c1dc55fceb
2 changed files with 7 additions and 12 deletions

View File

@ -50,11 +50,11 @@ import shade
class OpenStackInventory(object):
def __init__(self, private=False, refresh=False):
def __init__(self, refresh=False):
config_files = [ os.environ.get('OPENSTACK_CONFIG_FILE', None)
or '/etc/ansible/openstack.yml' ]
self.openstack_config = os_client_config.config.OpenStackConfig(
os_client_config.config.CONFIG_FILES.append(
'/etc/ansible/openstack.yml'),
private)
config_files)
self.clouds = shade.openstack_clouds(self.openstack_config)
self.refresh = refresh
@ -92,10 +92,8 @@ class OpenStackInventory(object):
hostvars = collections.defaultdict(dict)
for cloud in self.clouds:
# Cycle on servers
for server in cloud.list_servers():
meta = cloud.get_server_meta(server)
if 'interface_ip' not in meta['server_vars']:
@ -131,9 +129,6 @@ class OpenStackInventory(object):
def parse_args():
parser = argparse.ArgumentParser(description='OpenStack Inventory Module')
parser.add_argument('--private',
action='store_true',
help='Use private address for ansible host')
parser.add_argument('--refresh', action='store_true',
help='Refresh cached information')
group = parser.add_mutually_exclusive_group(required=True)
@ -146,7 +141,7 @@ def parse_args():
def main():
args = parse_args()
try:
inventory = OpenStackInventory(args.private, args.refresh)
inventory = OpenStackInventory(args.refresh)
if args.list:
inventory.list_instances()
elif args.host:
@ -158,4 +153,4 @@ def main():
if __name__ == '__main__':
main()
main()

View File

@ -8,7 +8,7 @@ RUN apt-get update
RUN apt-get install -y software-properties-common python-software-properties
RUN add-apt-repository -y ppa:chris-lea/redis-server; add-apt-repository -y ppa:chris-lea/zeromq; add-apt-repository -y ppa:chris-lea/node.js
RUN apt-get update
RUN apt-get install -y tmux git mercurial subversion python-dev python-pip libyaml-dev python-yaml python-paramiko python-jinja2 make postgresql python-psycopg2 python-ldap nodejs redis-server python-gevent libzmq3 python-zmq && rm -rf /var/lib/apt/lists/*
RUN apt-get install -y tmux git mercurial subversion python-dev python-pip libyaml-dev python-yaml python-paramiko python-jinja2 make postgresql python-psycopg2 python-ldap nodejs redis-server python-gevent libzmq3 python-zmq python-netifaces && rm -rf /var/lib/apt/lists/*
RUN git clone http://d7f73f8614295715a4777bf15f46d0d486ad0e21:x-oauth-basic@github.com/ansible/ansible-commander.git tower
RUN pip install Django==1.6.7 django-devserver django-debug-toolbar django-jenkins ipython ansible
RUN cd /tower ; make develop