mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
handle user-data for metadata grains
This commit is contained in:
parent
083846fe0e
commit
19bd1d9db5
1 changed files with 3 additions and 1 deletions
|
@ -48,9 +48,11 @@ def _search(prefix="latest/"):
|
|||
Recursively look up all grains in the metadata server
|
||||
'''
|
||||
ret = {}
|
||||
linedata = http.query(os.path.join(HOST, prefix))
|
||||
linedata = http.query(os.path.join(HOST, prefix), headers=True)
|
||||
if 'body' not in linedata:
|
||||
return ret
|
||||
if linedata['headers'].get('Content-Type', 'text/plain') == 'application/octet-stream':
|
||||
return linedata['body']
|
||||
for line in linedata['body'].split('\n'):
|
||||
if line.endswith('/'):
|
||||
ret[line[:-1]] = _search(prefix=os.path.join(prefix, line))
|
||||
|
|
Loading…
Add table
Reference in a new issue