Giter VIP home page Giter VIP logo

ansible-dyninv-mysql's People

Contributors

0bp avatar carsten-neuendorf avatar dvershinin avatar tanji avatar terwey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ansible-dyninv-mysql's Issues

`host`.`variables`. How to fill?

Hi,

Can somebody help me with any example of host.variables filling? I use this excellent script to pull all my switches from MySQL and it works perfect with Python 3 but I have several switches that use different username/password and I can't understand how to fill variables to use other name/password combination for these specific switches.
Please, help.

Roman

Got a python exception when var is null.

Issue Description

Hi,

I got a exception on line:189 when 'vars' not in self.inventory[groupname].

if not self.inventory[group]['hosts']:

Fixes a bug where a group might not have variables(8b71929)

Maybe self.inventory[group] should be dict, not list.
Is that right? @terwey @tanji

if 'vars' not in self.inventory[groupname]:
self.inventory[groupname] = list()

Environment

  1. Python 2.7.5

Steps to reproduce

  1. git clone https://github.com/productsupcom/ansible-dyninv-mysql.git
  2. Prepare the table schema: tables.sql
  3. Insert data to MySQL:
insert into `host` (id,host,hostname,variables,enabled) values (1,'10.128.0.1','node1','',1);
insert into `group` (id,name,variables,enabled) values (1,'group_A','',1);
insert into `hostgroups` (host_id,group_id) values (1,1);
  1. Execute command:
python mysql.py --list
  1. Expected result:
$ python mysql.py --list
Traceback (most recent call last):
  File "mysql.py", line 254, in <module>
    MySQLInventory()
  File "mysql.py", line 57, in __init__
    self.update_cache()
  File "mysql.py", line 189, in update_cache
    if not self.inventory[group]['hosts']:
TypeError: list indices must be integers, not str

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.