mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-05 07:54:00 -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
|
@ -64,9 +64,9 @@ CONFIG_FILES = ['/etc/stacki/stacki.yml', '/etc/ansible/stacki.yml']
|
|||
|
||||
|
||||
def stack_auth(params):
|
||||
endpoint = params['stacki_endpoint']
|
||||
auth_creds = {'USERNAME': params['stacki_user'],
|
||||
'PASSWORD': params['stacki_password']}
|
||||
endpoint = params['stacki_endpoint']
|
||||
auth_creds = {'USERNAME': params['stacki_user'],
|
||||
'PASSWORD': params['stacki_password']}
|
||||
|
||||
client = requests.session()
|
||||
client.get(endpoint)
|
||||
|
@ -99,17 +99,18 @@ def stack_build_header(auth_creds):
|
|||
|
||||
def stack_host_list(endpoint, header, client):
|
||||
|
||||
stack_r = client.post(endpoint, data=json.dumps({ "cmd": "list host"}),
|
||||
stack_r = client.post(endpoint, data=json.dumps({"cmd": "list host"}),
|
||||
headers=header)
|
||||
return json.loads(stack_r.json())
|
||||
|
||||
|
||||
def stack_net_list(endpoint, header, client):
|
||||
|
||||
stack_r = client.post(endpoint, data=json.dumps({ "cmd": "list host interface"}),
|
||||
stack_r = client.post(endpoint, data=json.dumps({"cmd": "list host interface"}),
|
||||
headers=header)
|
||||
return json.loads(stack_r.json())
|
||||
|
||||
|
||||
def format_meta(hostdata, intfdata, config):
|
||||
use_hostnames = config['use_hostnames']
|
||||
meta = dict(all=dict(hosts=list()),
|
||||
|
@ -159,7 +160,6 @@ def parse_args():
|
|||
def main():
|
||||
args = parse_args()
|
||||
|
||||
|
||||
if StrictVersion(requests.__version__) < StrictVersion("2.4.3"):
|
||||
sys.exit('requests>=2.4.3 is required for this inventory script')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue