Skip to content

Instantly share code, notes, and snippets.

@bhcopeland
Created November 26, 2015 14:41
Show Gist options
  • Save bhcopeland/5a4d876d110d07be4682 to your computer and use it in GitHub Desktop.
Save bhcopeland/5a4d876d110d07be4682 to your computer and use it in GitHub Desktop.
def get_component_ids(auth_content, components):
host_ids = []
for x in range(0, len(auth_content["result"])):
for comp in components:
if auth_content["result"][x]["name"].lower() == comp.lower():
host_ids.append(auth_content["result"][x]["_id"])
host_ids.append(auth_content["result"][x]["containers"][0]["_id"])
else:
return 1, None, comp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment