def docker_container_ids(broker): containers = broker[DefaultSpecs.docker_list_containers] try: result = set() for l in containers.content[1:]: result.add(l.split(None)[3].strip()) except: raise ContentException("No docker containers.") if result: return list(result) raise ContentException("No docker containers.")
def docker_image_ids(broker): """Command: docker_image_ids""" images = broker[DefaultSpecs.docker_list_images] try: result = set() for l in images.content[1:]: result.add(l.split(None)[3].strip()) except: raise ContentException("No docker images.") if result: return list(result) raise ContentException("No docker images.")