'This function will download all profiles and cache them locally.'

def GetAllProfiles(self, version=constants.PROFILE_REPOSITORY_VERSION):

    inv_profile = self.GetProfileByName('inventory', ignore_cache=True, version=version)
    inventory_json = zlib.decompress(inv_profile.data, (16 + zlib.MAX_WBITS))
    inventory = json.loads(inventory_json)
    for profile in inventory['$INVENTORY'].keys():
        logging.info('Getting    profile:    %s', profile)
        try:
            self.GetProfileByName(profile, ignore_cache=True, version=version)
        except urllib2.URLError as e:
            logging.info('Exception:    %s', e)
