mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-12 19:34:02 -07:00
pep8 fixes for contrib (#24344)
This commit is contained in:
parent
c7ae6b9fd5
commit
d3249e7875
37 changed files with 326 additions and 380 deletions
|
@ -113,6 +113,7 @@ load_chube_config()
|
|||
# Imports for ansible
|
||||
import ConfigParser
|
||||
|
||||
|
||||
class LinodeInventory(object):
|
||||
def __init__(self):
|
||||
"""Main execution path."""
|
||||
|
@ -171,11 +172,11 @@ class LinodeInventory(object):
|
|||
"""Command line argument processing"""
|
||||
parser = argparse.ArgumentParser(description='Produce an Ansible Inventory file based on Linode')
|
||||
parser.add_argument('--list', action='store_true', default=True,
|
||||
help='List nodes (default: True)')
|
||||
help='List nodes (default: True)')
|
||||
parser.add_argument('--host', action='store',
|
||||
help='Get all the variables about a specific node')
|
||||
help='Get all the variables about a specific node')
|
||||
parser.add_argument('--refresh-cache', action='store_true', default=False,
|
||||
help='Force refresh of cache by making API requests to Linode (default: False - use cache files)')
|
||||
help='Force refresh of cache by making API requests to Linode (default: False - use cache files)')
|
||||
self.args = parser.parse_args()
|
||||
|
||||
def do_api_calls_update_cache(self):
|
||||
|
@ -245,10 +246,10 @@ class LinodeInventory(object):
|
|||
# Need to load index from cache
|
||||
self.load_index_from_cache()
|
||||
|
||||
if not self.args.host in self.index:
|
||||
if self.args.host not in self.index:
|
||||
# try updating the cache
|
||||
self.do_api_calls_update_cache()
|
||||
if not self.args.host in self.index:
|
||||
if self.args.host not in self.index:
|
||||
# host might not exist anymore
|
||||
return self.json_format_dict({}, True)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue